Skip to main content
objectWorkflow

Fields

id
ID!
name
String!
trigger
String!

JSON-encoded trigger configuration, shaped as { "type": <triggerType>, ... }. Valid types and their required fields:

  • manual — no extra fields; the workflow runs only via the triggerWorkflow mutation or a UI button.
  • events — events: string[] (at least one); runs on the listed domain events, e.g. thread.thread_created, thread.message_added, thread.thread_field_updated, thread.thread_labels_changed, thread.thread_status_transitioned, thread.thread_discussion_created, thread.thread_discussion_message_created, thread.thread_discussion_resolved (Slack and email discussions only; AI agent replies do not fire the message event). thread.service_level_agreement_status_transitioned fires on a status change of any SLA type; thread.first_response_time_service_level_agreement_status_transitioned, thread.next_response_time_service_level_agreement_status_transitioned, thread.first_resolution_time_service_level_agreement_status_transitioned and thread.total_resolution_time_service_level_agreement_status_transitioned fire only when an SLA of that type changes status. slack.reaction_added fires when any Slack emoji is added to a message already on a thread, including a reply; pair it with a slack_emoji_equals condition to match one emoji.
  • schedule — cron: string; runs on a recurring cron schedule evaluated in UTC. Examples: {"type":"events","events":["thread.thread_field_updated"]}, {"type":"events","events":["thread.total_resolution_time_service_level_agreement_status_transitioned"]}, {"type":"events","events":["slack.reaction_added"]}.
startStepId
ID

The ID of the first step to execute, or null if the workflow has no steps. This cannot be cleared to null on a published workflow (Cannot clear startStepId on a published workflow); to restructure a published workflow's steps, unpublish it first (updateWorkflow with isPublished: false), restructure, then republish.

steps

The steps in this workflow.

publishedAt

Timestamp when the workflow was last published. Null means the workflow is an inactive draft.

position
String!

Opaque sort key. Compare lexicographically to order workflows within a workspace — the connection is already returned in this order. Sorting locally cannot disagree with the server: the encoding is ASCII-only (0-9A-Za-z), so JavaScript's < matches the database's byte ordering. Do not construct, parse or persist it: the encoding may change. To reorder, use moveWorkflow, which takes IDs.

order
Int!

1-based dispatch priority among published event workflows with a start step, derived from position, so moveWorkflow changes it. A lower number is always considered first, though only the workflows listening for the arriving event run. 0 for anything outside that set.

lastTriggeredAt

When this workflow was most recently triggered, or null if it never has been. Dates the trigger rather than the outcome, so a queued or failed run sets it as a successful one does.

sourceTemplateId
ID

The gallery template this workflow was created from, if any. Provenance only: the template may since have changed or been retired, and the workflow diverges as soon as it is edited.

Entities this workflow's steps reference, deduplicated across steps. Presence means a step carries the id; whether that step runs depends on the workflow being published and its conditions matching.

createdAt
createdBy
updatedAt
updatedBy