Skip to main content
POST
/
orgs
/
{org_id}
/
workflows
/
{workflow_id}
/
runs
Run a Workflow
curl --request POST \
  --url https://api.useinvent.com/orgs/{org_id}/workflows/{workflow_id}/runs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": {},
  "stream": true,
  "background": true,
  "workflow_version_id": "latest",
  "from_step_key": "<string>",
  "identifier": "<string>"
}
'
{
  "id": "<string>",
  "status": "RUNNING",
  "origin": "WORKFLOW",
  "started_at": "2023-11-07T05:31:56Z",
  "ended_at": "2023-11-07T05:31:56Z",
  "org_id": "<string>",
  "workflow_org_id": "<string>",
  "workflow_id": "<string>",
  "workflow_version_draft": {
    "steps": [
      {
        "type": "note",
        "key": "<string>",
        "input": {
          "note": "<string>"
        },
        "display": "expanded",
        "loop": "<string>",
        "throw_on_error": true,
        "start_connected": true,
        "destinations": [
          "<string>"
        ],
        "position": [
          123,
          123
        ],
        "definitions": [
          {
            "path": "<string>",
            "definition": {}
          }
        ],
        "size": [
          101,
          1
        ],
        "auto": {
          "model": "<string>",
          "temperature": 1
        }
      }
    ]
  },
  "workflow_version": {
    "id": "<string>",
    "workflow_id": "<string>",
    "description": "<string>",
    "version": 123,
    "notes": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "steps": [
      {
        "type": "note",
        "key": "<string>",
        "input": {
          "note": "<string>"
        },
        "display": "expanded",
        "loop": "<string>",
        "throw_on_error": true,
        "start_connected": true,
        "destinations": [
          "<string>"
        ],
        "position": [
          123,
          123
        ],
        "definitions": [
          {
            "path": "<string>",
            "definition": {}
          }
        ],
        "size": [
          101,
          1
        ],
        "auto": {
          "model": "<string>",
          "temperature": 1
        }
      }
    ],
    "rollback_version": 123,
    "created_by": {
      "id": "<string>",
      "name": "<string>",
      "avatar": "<string>"
    }
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "result": "<unknown>",
  "outputs": {},
  "error": "<string>",
  "version": 123,
  "usage": {
    "total": 123,
    "ai_total": 123,
    "steps": {},
    "calls": [
      {
        "id": "<string>",
        "total": 123,
        "ai_total": 123,
        "calls": [
          null
        ]
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.useinvent.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key

Path Parameters

org_id
string
required

The ID of the org

workflow_id
string
required

The ID of the workflow

Query Parameters

expand
boolean

Body

Data to create a new run

input
object

Values of the fields

stream
boolean

Indicates if the run should stream output to the client as it becomes available via SSE (Server-Sent Events)

background
boolean

Indicates if the run should be executed in the background and return the run information immediately

workflow_version_id

ID of the workflow version. Use "latest", "draft" or "version number" for a specific version

Available options:
draft,
latest
Example:

"latest"

from_step_key
string

Step key to start the run from

identifier
string

Temporary WebSocket identifier used to track run status before creation completes

Maximum string length: 256

Response

200 - application/json
id
string
required

Unique identifier for the run

status
enum<string>
required

Status of the run

Available options:
PENDING,
RUNNING,
CANCELED,
COMPLETED,
SKIPPED,
FAILED
Example:

"RUNNING"

origin
enum<string>
required

Origin of the run

Available options:
WORKFLOW,
TRIGGER,
WEBHOOK
Example:

"WORKFLOW"

started_at
string<date-time> | null
required

Timestamp of when the run started

ended_at
string<date-time> | null
required

Timestamp of when the run ended

org_id
string
required

ID of the associated org where the run was triggered from

workflow_org_id
string
required

ID of the associated org where the workflow belongs to

workflow_id
string
required

ID of the associated workflow

workflow_version_draft
object
required

Draft version of the workflow

workflow_version
object
required

Details of the workflow version used for the run

created_at
string<date-time> | null
required

Timestamp of when the run was created

updated_at
string<date-time> | null
required

Timestamp of when the run was last updated

result
any

Result of the run

outputs
object

Outputs of all steps in the run

error
string

Error message if the run failed

version
number

Version number of the workflow

usage
object

Credits usage of the run