Workflow

Get a workflow

GET/api/v1/workflows/{id}

Returns one workflow with its trigger, conditions and actions. SLA policies (type sla and ticket_sla) can be read here too.

Secrets of a Send Webhook action (auto.webhook) are hidden: header values, the request body, and the path, credentials and query-string values of the URL are returned as ***redacted***. The scheme, host and port of the URL are kept.

Conditions and actions can carry extra display fields written by the app's workflow builder (uiValue, uiFilterOperator, type, badges, stamp). They are returned as stored.

Required ability: workflows:read.

Request

Authorization

Bearer Token

Provide your API token in the Authorization header. See Authentication to issue one.

Example:Authorization: Bearer ********************

Path Params
  • idstring<uuid>required

    The workflow id (UUID).

    Example:6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d

Responses

200

The workflow.

  • idstring<uuid> | nulloptional

    null only in the preview of a create dry run.

  • namestringoptional
  • typestringoptional

    Allowed values:"workflow", "sla", "ticket_sla"

  • priorityinteger | nulloptional

    Position in the evaluation order within its type; 1 is first.

  • enabledbooleanoptional
  • custombooleanoptional

    true for a workflow that agents run by hand (trigger when_manually_triggered).

  • triggerWorkflowTriggeroptional
    Child attributes
    • eventsarray[string]required

      Trigger ids from GET /api/v1/workflows/schema. The workflow runs when any of them happens. A trigger marked exclusive in the schema cannot be combined with others.

      Example:["when_chat_room_is_open"]

    • delaySecondsintegeroptional

      Seconds to wait. Required with a trigger marked supportsDelay in the schema, and not allowed otherwise.

  • conditionsarray[array[WorkflowCondition]]optional

    Groups of conditions. Every group must match (AND); within a group any one condition may match (OR). An empty list means always.

    Child attributes
    • keystringrequired

      A condition id from GET /api/v1/workflows/schema.

      Example:contact.name

    • operatorstring | nulloptional

      One of the operators the schema lists for this condition, for example equal or contains.

    • valuesanyoptional

      What to compare with. Its shape depends on the condition (valueType in the schema): usually a string, for some conditions an object.

    • uiValuestring | nulloptional

      Display text used by the app's workflow builder. Optional.

    • uiFilterOperatorstring | nulloptional

      Display text used by the app's workflow builder. Optional.

    • typestring | nulloptional

      Display hint used by the app's workflow builder. Optional.

    • badgesanyoptional

      Display data used by the app's workflow builder. Optional.

  • actionsarray[WorkflowAction]optional

    The actions, run in order.

    Child attributes
    • keystringrequired

      An action id from GET /api/v1/workflows/schema.

      Example:auto.assign

    • valuesanyoptional

      The action's settings. Its shape depends on the action (valueType and fields in the schema): a string or an object.

    • uiValuestring | nulloptional

      Display text used by the app's workflow builder. Optional.

    • stampbooleanoptional

      Show the action in the inbox when it runs. Only for actions marked supportsStamp in the schema.

  • createdAtstring<date-time> | nulloptional
  • updatedAtstring<date-time> | nulloptional
401

The API token is missing or invalid.

403

The API token does not have the ability this endpoint requires. See "Token abilities" in the introduction.

  • messagestringrequired
  • errorstringoptional
  • statusCodeintegerrequired
404

No workflow with this id exists for the token's tenant, or id is not a UUID.

  • messagestringrequired
  • errorstringoptional
  • statusCodeintegerrequired