Skip to main content

Speckle Automate API Reference

This reference documents the essential APIs and interfaces for developing functions in Speckle Automate. All APIs are available in both Python and C# SDKs.
Start with the Quickstart Guide to understand the basic concepts before using this API reference.

Function Inputs

Function inputs define what users can configure when running your automation. They automatically generate forms in the web interface.

Supported Types

Validation Attributes

Example: Simple Inputs

simple_inputs.py

Example: Dropdown Selections

dropdown_selections.py

Example: Secure Inputs

secure_inputs.py

Automation Context

The AutomationContext is your function’s interface to Speckle. It provides access to data, authentication, and methods for reporting results.

Properties

automation_run_data
AutomationRunData
Metadata about the current automation run, including run ID, trigger information, and execution context
speckle_client
SpeckleClient
Pre-configured, authenticated client for Speckle API calls. Provides full access to the Speckle SDK functionality.
function_inputs
FunctionInputs
User-provided configuration values that were specified when the automation was triggered
🔧 Full SDK Access: The speckle_client property provides access to the complete Speckle SDK functionality. You can use all features from SpecklePy (Python) or SpeckleSharp (C#) within your Automate functions.📚 Python API Documentation: For detailed, auto-generated API reference documentation for specklepy, visit the specklepy API Documentation.

Methods

receive_version()
Base
Get the model that triggered this automation. Returns the complete Speckle data structure.
mark_run_success(message)
void
Report successful completion of the automation. Call this when your function completes successfully.
mark_run_failed(message)
void
Report business logic failure. Use this when validation fails or business rules are violated.
mark_run_exception(message)
void
Report unexpected error. Use this when an exception occurs that wasn’t part of normal business logic.
attach_error_to_objects(category, object_ids, message, metadata?)
void
Mark specific objects with errors. Useful for validation failures or processing errors on individual elements.
attach_warning_to_objects(category, object_ids, message, metadata?)
void
Add warnings to specific objects. Use for performance issues, recommendations, or non-critical problems.
attach_success_to_objects(category, object_ids, message, metadata?)
void
Mark objects as successfully processed. Useful for tracking which elements were processed correctly.
create_new_version_in_project(project_id, data, message)
string
Create a new model version with modified data. Returns the ID of the newly created version.
store_file_result(file_path, file_name)
string
Save a file as an artifact. Useful for reports, exports, or analysis results. Returns the artifact ID.

Getting Model Data

getting_model_data.py

Status Reporting

Your function must report its final status using one of these methods:
status_reporting.py

Annotating Objects

Add status information to specific objects in the model:
annotating_objects.py

Creating New Model Versions

creating_versions.py

Saving Files

saving_files.py

Working with Speckle Data

Data Structure

Speckle models are directed acyclic graphs (DAGs):
  • Objects can reference other objects
  • Properties can be primitive values or object references
  • References are one-way (parent → child)
  • Common properties: elements, parameters, units, applicationId

Complete Function Example

Here’s a complete example that demonstrates all the key concepts:
complete_example.py

Next Steps

Last modified on July 18, 2026