Skip to main content

Executing Workflows

Once you build a workflow, you need to run it.

Note: The exact execution API is currently handled via the Culvii platform. You deploy your workflow using Workflow.save(), and the platform handles the runtime execution, pausing, and state management.

Deploying your workflow

To run a workflow, you first serialize it and send it to the Culvii platform. The SDK provides methods to convert your workflow into the JSON format the platform expects.

// Get the raw definition
const definition = workflow.toJSON();

// Or get the validated runtime shape (throws if connections are invalid)
const runtimeShape = workflow.toRuntimeWorkflow();

Once serialized, you deploy it to your workspace. The platform takes over from there.

Pausing and resuming

Workflows often need to wait for external events, like a user clicking an email link or an admin approving a request.

When a step is configured to wait, the platform pauses the workflow execution, serializes the current state, and stores it. Once the external event occurs (via a webhook or API call), the platform rehydrates the state and resumes execution from the exact point it paused.

You don't need to write custom state management code for this. The platform handles the serialization and resumption automatically.

State and data flow

As a workflow executes, each step receives input data, processes it, and passes output data to the next connected step.

The platform maintains this state throughout the execution lifecycle. If a workflow fails or pauses, you can inspect the state of each step in the Culvii dashboard to debug data issues or trace execution paths.