Workflows

Documentation for Workflows

Base path: /api/v1/workflows

Workflows are the core automation unit in the platform. Each workflow has a definition (steps, inputs, environment variables, schedule) and can have multiple published versions plus an active draft.

All endpoints require JWT authentication and an x-active-org header.


Endpoints Overview

MethodPathAuthDescription
GET/api/v1/workflowsJWTList workflows
GET/api/v1/workflows/:workflowIdJWTGet workflow details
GET/api/v1/workflows/:workflowId/versionsJWTList workflow versions
POST/api/v1/workflows/:workflowId/versions/:versionId/defaultJWTSet default version
DELETE/api/v1/workflows/:workflowIdJWTDelete a workflow
POST/api/v1/workflows/:workflowId/envsJWTSave environment variables
PATCH/api/v1/workflows/:workflowId/sharingJWTUpdate team sharing
GET/api/v1/workflows/:workflowId/upcoming-runsJWTGet upcoming scheduled runs
PUT/api/v1/workflows/:workflowId/scheduleJWTPause or resume schedule
POST/api/v1/workflows/:workflowId/schedule/parseJWTParse natural-language schedule
DELETE/api/v1/workflows/:workflowId/scheduleJWTDelete schedule

Workflow Object

The workflow field in responses is in planner format (human-readable):

json

GET /api/v1/workflows

Lists workflows owned by the authenticated user within the active organization.

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (min: 1)
limitnumber20Items per page (min: 1, max: 100)
isDraftbooleanfalseIf true, lists workflows with a draft (not yet published)
searchstring–Search by workflow name (case-insensitive substring)

Response 200 OK

json

Workflow list item fields:

FieldTypeDescription
idstring (UUID)Workflow ID
namestringWorkflow name
descriptionstring | nullDescription
servicesstring[]List of service slugs used in workflow steps
createdAtstring (ISO 8601)Creation time
updatedAtstring (ISO 8601)Last update time
scheduleStatusboolean | nulltrue = paused, false = active, null = no schedule
sharedTeamKeysstring[]Teams this workflow is shared with

GET /api/v1/workflows/:workflowId

Returns full details of a specific workflow including its current published definition.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Response 200 OK

json
FieldTypeDescription
idstring (UUID)Workflow ID
namestringName from default version
descriptionstring | nullDescription from default version
sharedTeamKeysstring[]Teams this workflow is shared with
isPausedboolean | nullSchedule pause state; null if no schedule
versionstring | nullDefault version number as string
isPublicbooleanWhether the workflow is publicly visible
isDraftbooleanWhether an unpublished draft exists
createdAtstring (ISO 8601)Creation time
updatedAtstring (ISO 8601)Last update time
workflowobject | nullFull workflow definition in planner format

GET /api/v1/workflows/:workflowId/versions

Lists published versions of a workflow, newest first.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Query Parameters

ParameterTypeDefaultDescription
limitnumber20Max versions to return (min: 1, max: 100)
includeAllbooleanfalseIf true, returns all versions (ignores limit)

Response 200 OK

json
FieldTypeDescription
versionsarrayList of version objects
totalnumberTotal number of versions
truncatedbooleanWhether results were truncated by the limit

Version object:

FieldTypeDescription
versionIdstring (UUID)Version ID
workflowIdstring (UUID)Parent workflow ID
versionNumbernumberSequential version number (1-indexed)
isDefaultbooleanWhether this is the active/default version
createdAtstring (ISO 8601)When this version was created

POST /api/v1/workflows/:workflowId/versions/:versionId/default

Sets a specific version as the default (active) version for a workflow. Requires workflow owner or write permission.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID
versionIdstring (UUID)Version ID to make default

Request

No request body required.

Response 200 OK

json

DELETE /api/v1/workflows/:workflowId

Soft-deletes a workflow. Only the workflow owner can delete it.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Response 200 OK

json

POST /api/v1/workflows/:workflowId/envs

Saves (upserts) environment variables for the workflow's default published version. Only works when the workflow has a published version.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Request Body (JSON)

FieldTypeRequiredDescription
envsarrayYesList of environment variable objects

Environment variable object:

FieldTypeRequiredDescription
namestringYesVariable name (min length: 1)
valuestringYesVariable value
descriptionstringNoHuman-readable description
json

Response 200 OK

json

PATCH /api/v1/workflows/:workflowId/sharing

Replaces the team sharing configuration for a workflow.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Request Body (JSON)

FieldTypeRequiredDefaultDescription
shareWithTeamKeysstring[]Yes[]Team keys to share with. Pass [] to revoke all sharing.
json

Response 200 OK

Returns the updated sharing result.


GET /api/v1/workflows/:workflowId/upcoming-runs

Returns the next scheduled execution times for a workflow's Temporal schedule.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Response 200 OK

json

Returns an empty array if no schedule is configured.


PUT /api/v1/workflows/:workflowId/schedule

Pauses or resumes the workflow's Temporal schedule.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Request Body (JSON)

FieldTypeRequiredDescription
pausedbooleanYestrue to pause, false to resume
json

Response 200 OK

json

Errors

StatusReason
404 Not FoundNo schedule exists for this workflow

POST /api/v1/workflows/:workflowId/schedule/parse

Parses a natural language schedule description, creates/updates the Temporal schedule, and returns a human-readable description.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Request Body (JSON)

FieldTypeRequiredDescription
inputstringYesNatural language schedule (e.g. "every Monday at 9am", "first day of month at midnight")
json

Response 200 OK

json
FieldTypeDescription
successbooleanAlways true on success
messagestringStatus message
schedulestring | nullHuman-readable description of the parsed schedule

Errors

StatusReason
400 Bad RequestCould not parse a valid schedule from the input
404 Not FoundWorkflow not found or no default version

DELETE /api/v1/workflows/:workflowId/schedule

Deletes the schedule for a workflow (removes from Temporal and the database).

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Response 200 OK

json

Errors

StatusReason
404 Not FoundNo schedule found for this workflow
api-docs/workflows.md