Skip to main content
Every run ends with a status that readers see in the Runs table: succeeded, failed, or exception. Report it explicitly, with a message that says what happened, so a failed run tells the reader what to fix.

Status reporting methods

The Python methods are synchronous: call them without await, from a plain def function. The C# methods are synchronous too, even inside your async Task Run.
main.py
AutomateFunction.cs
If you call more than one status method, the last call wins.

What the runner does for you

  • No status reported: when your function returns without one, the runner marks the run successful with a warning message.
  • Unhandled error: when your function throws, the runner catches it, marks the run as an exception, and writes the error to the run log. You do not need a try/except around the whole function.
In C#, the runner keeps only a failed or succeeded status when your function returns. A run marked with MarkRunException is replaced by the warning success, so throw instead.

Status types and when to use them

A function that runs but finds problems in the model should mark the run as failed, not as an exception. Keep exception for errors in the function: a bug, a network failure, a model it cannot read.

Best practices

  • Report the final status yourself. The runner’s fallback success message says the function forgot to.
  • Write messages a reader can act on. “12 walls have no Mark” beats “Process failed”.
  • Include counts. If the function checks a batch, say how many objects passed and failed.
  • Attach results to objects. A status says whether the run passed; object results say where.
Last modified on October 19, 2026