# Workflows Object

> Source: https://truto.one/docs/api-reference/admin/workflows/

Schema for the `Workflows` resource in **Admin API**.

## Properties

- **`id`** _(string)_
  The ID of the workflow.
- **`environment_id`** _(string)_
  The environment the workflow belongs to.
- **`trigger_name`** _(string)_
  The event that runs the workflow. `integrated_account:active` runs when an integrated account becomes active (for example right after it is connected); `unified_webhook:batch` runs when a batch of unified webhook events arrives. A `unified_webhook:batch` run is delivered at least once. After a failed hand-off it can be sent again, or carry the events of several deliveries, so dedupe on an id each event carries, such as its `event_id` where present or the provider's own id in `raw_payload`.
  Allowed: `integrated_account:active`, `unified_webhook:batch`
- **`config`** _(object, required)_
  Workflow execution configuration.
  - **`run_if`** _(string)_
    JSONata condition evaluated before executing workflow steps.
  - **`steps`** _(array<object>)_
    - **`type`** _(string)_
      Step execution type.
      Allowed: `run`
    - **`action`** _(string)_
      Action executed by the step. `run_sync_job` is the only action.
      Allowed: `run_sync_job`
    - **`run_if`** _(string)_
      JSONata condition; the step is skipped when it is falsy.
    - **`cron_expression`** _(string)_
      Optional cron expression for scheduled execution, in UTC. When set, the step creates a sync job cron trigger instead of starting a run, so the trigger's check applies: the step fails if the expression doesn't parse or its next two runs are less than 5 minutes apart.
    - **`config`** _(string | object)_
      A JSONata expression that returns the step's payload, or an object whose values may use `{{placeholders}}`. For `run_sync_job` it must give a `sync_job_id`.
- **`created_at`** _(string)_
  When the workflow was created.
- **`updated_at`** _(string)_
  When the workflow was last updated.

## Methods

- [GET /workflow](/docs/api-reference/admin/workflows/list) — List workflows
- [POST /workflow](/docs/api-reference/admin/workflows/create) — Create workflow
- [GET /workflow/{id}](/docs/api-reference/admin/workflows/get) — Get workflow
- [DELETE /workflow/{id}](/docs/api-reference/admin/workflows/delete) — Delete workflow
- [PATCH /workflow/{id}](/docs/api-reference/admin/workflows/update) — Update workflow
- [GET /workflow/{id}/versions](/docs/api-reference/admin/workflows/list-versions) — List workflow versions
- [GET /workflow/{id}/versions/{version}](/docs/api-reference/admin/workflows/get-version) — Get workflow version
- [POST /workflow/{id}/versions/{version}/restore](/docs/api-reference/admin/workflows/restore-version) — Restore workflow version
