Skip to content
SBDocs

Customers · API reference

Workflows

Find the workflows a key can run, and create new ones from a list of steps.

GETList workflows#

GET https://app.sushibelt.ai/api/v1/workflows

Lists the workflows this key can run, newest change first. Only your team's workflows are listed. If the key is limited to certain workflows, only those are listed. There is no pagination: every workflow is returned.

Needs an API key with the workflows:read scope. See Scopes.

Example request#

Set SUSHIBELT_API_KEY to your key first, and replace each YOUR_… value.

List workflows: request
curl "https://app.sushibelt.ai/api/v1/workflows" \
  -H "Authorization: Bearer $SUSHIBELT_API_KEY"

Responses#

  • 200 OK — The workflows this key can run. An empty list means the team has none, or the key may run none.
  • 401 Unauthorized — The key is missing, malformed, unknown, revoked or expired. Message: Unauthorized.
  • 403 Forbidden — The key does not have the workflows:read scope. Message: Scope not permitted for this key.
  • 429 Too many requests — Too many requests with this key. By default a key may make 60 requests a minute. Wait for the number of seconds in Retry-After. Message: Rate limit exceeded. Headers: Retry-After.
200 OK: response fields
NameDescription
workflowsarray of WorkflowSummary · RequiredNo description.
workflows[].idstring (uuid) · RequiredPass this to Run a workflow.
workflows[].namestring · RequiredNo description.
workflows[].descriptionstring or null · RequiredNo description.
workflows[].statusstring or null · RequiredOne of: draft, active, archived.
workflows[].updated_atstring or null (date-time) · RequiredNo description.
200 OK: example responseJSON
{
  "workflows": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "description": "string",
      "status": "draft",
      "updated_at": "2026-09-29T12:00:00Z"
    }
  ]
}

POSTCreate a workflow#

POST https://app.sushibelt.ai/api/v1/workflows

Creates a workflow from a list of steps. Sushibelt turns the steps into a canvas graph for you. The workflow belongs to an agent: pass agentId to add it to an existing agent, or projectId to create a new agent for it. Keys limited to certain workflows cannot create workflows.

Needs an API key with the workflows:write scope. See Scopes.

Request body#

Give exactly one of agentId and projectId.

Create a workflow: request body fields
NameDescription
namestring · RequiredThe workflow's name.
agentIdstring (uuid) · OptionalAdd the workflow to this agent.
projectIdstring (uuid) · OptionalCreate a new agent in this project and add the workflow to it.
agentNamestring · OptionalThe new agent's name, when you pass projectId. Defaults to name.
stepsarray of WorkflowStep · RequiredNo description.
steps[].keystring · RequiredA name for this step, unique within the request. Other steps refer to it in inputs.
steps[].typestring · RequiredThe node type. One of 55 values; see the list below.
steps[].labelstring · OptionalThe name shown on the canvas. Defaults to the node type's name.
steps[].configobject · OptionalThe node's settings; the fields depend on the node type. Set apiInputKey on a TextEntry or PromptBuilder step to let a run replace its value.
steps[].inputsarray of one of: string, WorkflowStepInput · OptionalThe steps this step reads from. A step key alone connects first output to first input.
steps[].inputs[].fromstring · RequiredThe key of the step to connect from.
steps[].inputs[].sourceHandlestring · OptionalThe output handle on that step.
steps[].inputs[].targetHandlestring · OptionalThe input handle on this step.

Example request#

Set SUSHIBELT_API_KEY to your key first, and replace each YOUR_… value.

Create a workflow: request
curl -X POST "https://app.sushibelt.ai/api/v1/workflows" \
  -H "Authorization: Bearer $SUSHIBELT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Fox portrait",
    "projectId": "00000000-0000-0000-0000-000000000000",
    "steps": [
      {
        "key": "subject",
        "type": "TextEntry",
        "config": {
          "text": "a red fox",
          "apiInputKey": "subject"
        }
      },
      {
        "key": "image",
        "type": "DiffusionWorker",
        "inputs": [
          "subject"
        ]
      },
      {
        "key": "preview",
        "type": "ImageGallery",
        "inputs": [
          "image"
        ]
      }
    ]
  }'

Responses#

  • 201 Created — The workflow was created.
  • 400 Bad request — The request is missing something: a name, at least one step, or exactly one of agentId and projectId. Messages: name is required, steps is required, Provide exactly one of agentId or projectId.
  • 401 Unauthorized — The key is missing, malformed, unknown, revoked or expired. Message: Unauthorized.
  • 403 Forbidden — The key does not have the workflows:write scope, or it is limited to certain workflows. Messages: Scope not permitted for this key, This key is not permitted to create workflows.
  • 404 Not found — The agent or project does not exist in your team. Message: Agent or project not found.
  • 422 Unprocessable content — The steps do not make a valid workflow: an unknown node type, a repeated step key, an input that names no step, or a graph that fails validation (the reasons are listed in errors). Messages: Unknown node type: "Foo", Workflow validation failed.
  • 429 Too many requests — Too many requests with this key. By default a key may make 60 requests a minute. Wait for the number of seconds in Retry-After. Message: Rate limit exceeded. Headers: Retry-After.
  • 500 Server error — Something failed on our side. Message: Server error: ….
201 Created: response fields
NameDescription
workflowIdstring (uuid) · RequiredNo description.
agentIdstring (uuid) · RequiredNo description.
projectIdstring (uuid) · RequiredNo description.
stepsCountinteger · RequiredNo description.
201 Created: example responseJSON
{
  "workflowId": "00000000-0000-0000-0000-000000000000",
  "agentId": "00000000-0000-0000-0000-000000000000",
  "projectId": "00000000-0000-0000-0000-000000000000",
  "stepsCount": 1
}
422 Unprocessable content: Error body
NameDescription
errorstring · RequiredWhat went wrong, in plain words.
422 Unprocessable content: WorkflowValidationFailed body
NameDescription
errorstring · RequiredAlways Workflow validation failed.
errorsarray of any · RequiredNo description.

Next steps