Skip to main content
A Workflow Definition is a JSON object that acts as the blueprint for an executable backend workflow. It describes the individual components, their configurations, and how they are wired together to process information linearly or conditionally.

High-Level Structure

Every Workflow Definition adheres to the following core JSON schema:

Top-Level Properties

Components Array

The components array contains objects detailing the individual processing units. Each component has an ID, a type definition, and configurations for its specific behavior and positional placement if rendered visually in the UI.
For an exhaustive list of components and their configurations, refer to the Workflow Components page.

The Component Object

A component is one object in the components array. id, category, type and name are required. A component that lacks one fails the check with Component `<label>` is missing required field(s): <fields>. The four categories are flow for the steps that give an execution its shape, data for a component that holds a value, processor for a step that does work, and provider for a component that supplies a service, such as a model or a credential, to a step. The Workflow Components page lists every type under its category.

Ports

A port entry carries a category, a route and a value.
  • category is the kind of port, as the component’s page lists it: data_input, data_output or provider_input.
  • route is the port’s name on that component. A port with no route fails with Port at position <n> (category: `<category>`) on component `<name>` is missing required field(s): route.
  • value is a value object, written as on Data Types: a type and the field that type reads, such as {"type": "text", "text": "..."} or {"type": "choice", "id": "session"}.
The definition lists only the ports it sets. A port it leaves out is not filled in with the editor’s default. A required port left out, with no connection that supplies it, fails the check with Port `<route>` (category: `<category>`) is required, and a data component’s persistence left out reads as none (Persistence).

Custom routes

A logic.code names its own routes. A route is whatever name its code uses, and the definition declares it where the route is used:
  • A flow route is a connection from the code component’s flow_output whose route is that name. The check does not read the program, so it cannot see which routes the program passes to set_result: a route with no connection fails the execution when the program names it, with Desired route ("<route>") is not satisfied in the workflow definition.
  • A data input is a data_input port with that route, or a connection from the component’s data_input to a data component’s data_reference. A data output is only the second kind, a connection from data_output: a program that writes a route with no such connection writes nothing. The program reads an input with get_data_input(route) and writes an output with set_data_output(route, value).
  • A provider is a connection from provider_input to the provider’s provider_reference, and the program reads it with get_provider_credential(route, ...).

Example

Corvel Freight books a carrier, waits for the carrier’s system to confirm, and then runs a check that reads the dispatch notes. flow.start leads to a logic.sleep with seconds set to 2.5, then to a logic.code, then to flow.end. The notes are a data.message kept in the session under the alias dispatch/carrier_notes: its persistence is session and it holds no inline value, so an earlier execution or an upload supplies it. A connection from the code component’s data_input to the message’s data_reference, with the route carrier_notes, is how the program reads it.
A data or provider component that no connection refers to fails with Component `<name>` is not referred to, so the data.message needs c4. A component with no connection leading to it fails with Component `<name>` is unreachable, and one with no flow connection leaving it fails with Component `<name>` does not have outbound connections.

The check

upload_definition stores a definition after checking its shape against the schema, not the rules of the manifest. An execution runs the manifest check when it starts, the same one the Check Definition operation runs, and a definition that fails it ends the execution with a flow.error event, Workflow definition check failed, whose data.events holds the findings. A hand-written definition therefore goes upload, check, create a session, create an execution; the check is the step that shows a refusal before a run does.

Connections Array

The connections array defines how control passes between components upon execution. Connections are directional edges between a specific output “route” of a source component and a specific input “route” of a target component.

Connection Properties

  • id: The connection’s own identifier, unique within the definition. Required — a definition whose connections omit it, or reuse one, fails validation and will not execute. Visual editors key their edges by this value, so connections without one collapse into a single edge when the workflow is drawn.
  • source_id: The ID of the component yielding control.
  • target_id: The ID of the component receiving control.
  • source_port: The physical output port the connection originates from.
  • target_port: The physical input port the connection arrives at.
  • route: The semantic logic path dictating when this edge fires (e.g., "success", "failure", "next").

Connector Placement

Every component exposes its connectors at fixed positions on the node. Knowing where each one sits lets you place components (via their position) so edges stay short and non-crossing — clean, readable flows. The diagram below shows all connector types on a single component (logic.code) and the components they connect to:
Workflow connector placement — flow in/out on top/bottom, data on the right, provider on the leftWorkflow connector placement — flow in/out on top/bottom, data on the right, provider on the left
Data and provider components expose the matching reference ports (data_reference, provider_reference) so the edges land on their facing side.

Laying out clean flows

Because the connectors are fixed, a few conventions produce tidy definitions:
  • Flow runs top → bottom. flow_input is on the top edge and flow_output on the bottom, so stack sequential steps vertically — same x, increasing y.
  • Data sits to the right. data_input and data_output exit the right side, so place the message / list / data components a step reads or produces to its right.
  • Providers sit to the left. provider_input is on the left edge, so place provider components to the left.
The position field ({ "x", "y" }) on each component is what the editor renders from; following these conventions keeps the graph legible.