Speckle Automate API Reference
This reference covers function inputs and the automation context in the Python and C# Automate SDKs. Where the two SDKs differ, the reference says so.To process versions published in 2026.9, a function needs specklepy 2026.9.0b3 with the
bundle extra (specklepy[bundle]==2026.9.0b3), or Speckle.Automate.Sdk 2026.9.0-beta.4 or
later. A stable 2026.9.0 release replaces the beta pin.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
In C#,
FunctionInputs must be a struct: the runner’s Main<TInput> constrains TInput to a struct, so a class does not compile. Set defaults with [DefaultValue].
Example: Simple Inputs
simple_inputs.py
Example: Dropdown Selections
dropdown_selections.py
Example: Secure Inputs
secure_inputs.py
Automation Context
The automation context is your function’s interface to Speckle. It gives you the run’s data, an authenticated client, and the methods for reporting results. In Python your function receives anAutomationContext. In C# it receives an IAutomationContext: the concrete AutomationContext class is internal, so type your parameters with the interface.
Properties
Metadata about the current run: project ID, server URL, automation and run IDs, and the triggers
that started it.
speckle_client gives you the rest of the SDK: everything in
specklepy (Python) or
Speckle.Sdk (C#) is available inside your function. For
generated specklepy reference, see the specklepy API
documentation.Methods
The Python methods are synchronous: call them withoutawait, from a plain def function. In C#, ReceiveVersion, CreateNewVersionInProject, WaitForVersion, and StoreFileResult return a Task; the status and attach methods are synchronous.
Getting model data
receive_version.py
ReceiveVersion.cs
Base tree. For the shape of that tree, see Handling Data in Functions.
Status reporting
Report the run’s final status with one of these methods. If you call more than one, the last call wins.status_reporting.py
StatusReporting.cs
Annotating objects
Attach a result to the objects it concerns. Pass the objects themselves, not their IDs.annotating_objects.py
AnnotatingObjects.cs
attach_result_to_objects / AttachResultToObjects takes the same arguments after a leading level (ObjectResultLevel).
Creating new model versions
Both SDKs refuse to publish to the model that triggered the run, so an automation cannot trigger itself.create_new_version.py
CreateNewVersion.cs
Version and records it on the run’s results. Its id is reserved: the version appears once the server finishes processing it, so wait before you read it back in the same run. See Wait for the version.
Publish a bundle
In C#, Speckle.Automate.Sdk 2026.9.0-beta.4 and later add aCreateNewVersionInProject overload that takes a BundleBuilder. It publishes through a model ingestion, like Send3, and returns a SendResult as soon as the upload completes. The server creates the version when it finishes ingesting, so call WaitForVersion before your function returns. Otherwise the run’s result links can point at a version that does not exist yet.
PublishBundle.cs
Saving files
store_file_result.py
StoreFileResult.cs
Working with Speckle Data
receive_version() / ReceiveVersion() return a Base tree. For a version published in 2026.9, that tree is a Collection root whose elements hold nested Collections and DataObjects, each with name, displayValue, and properties. Handling Data in Functions shows how to walk and filter it.
Complete Function Example
This function checks that every object in a chosen category has a value for a chosen property. It fails the run and flags the objects that do not.main.py
Program.cs, which registers it and passes Run to the runner. See Making Your Function.
Next Steps
- Function Inputs - Detailed input configuration
- Working with Data - Advanced data processing patterns
- Function Testing - Testing your functions
- Creating Automations - Setting up automation workflows