> ## Documentation Index
> Fetch the complete documentation index at: https://loops.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a workflow

> Retrieve a simplified workflow graph showing each node's type, outgoing connections, and selected display fields for visualizing the workflow.

<Warning>
  Workflow API endpoints are currently in alpha and are subject to change.
</Warning>

Returns a simplified view of the workflow graph. Each node includes its `typeName`, outgoing connections in `nextNodeIds`, and selected display fields. Use [Get workflow node](/api-reference/get-workflow-node) to retrieve full details for a single node.

## Request

### Path parameters

<ParamField path="id" type="string" required>
  The ID of the workflow.
</ParamField>

## Response

### Success

<ResponseField name="id" type="string" required>
  The workflow's ID.
</ResponseField>

<ResponseField name="name" type="string">
  The workflow's name.
</ResponseField>

<ResponseField name="description" type="string">
  The workflow's description.
</ResponseField>

<ResponseField name="emoji" type="string">
  The workflow's emoji.
</ResponseField>

<ResponseField name="mailingListId" type="nullable string">
  The ID of the [mailing list](/api-reference/list-mailing-lists) the workflow is sent to.
</ResponseField>

<ResponseField name="rootNodeId" type="nullable string" required>
  The ID of the workflow's trigger node.
</ResponseField>

<ResponseField name="nodes" type="object" required>
  A map of node IDs to simplified node objects. Each node includes `typeName` and `nextNodeIds`, plus type-specific fields when present.

  <Expandable title="Node types">
    <ResponseField name="SignupTrigger" type="object">
      Triggered when a contact is added to your audience.
    </ResponseField>

    <ResponseField name="EventTrigger" type="object">
      Triggered when an event is received. May include `eventName` and `reEligible`.
    </ResponseField>

    <ResponseField name="ContactPropertyTrigger" type="object">
      Triggered when a contact property changes. May include `contactPropertyQuery` and `reEligible`.
    </ResponseField>

    <ResponseField name="AddToListTrigger" type="object">
      Triggered when a contact is added to a mailing list. May include `mailingList` and `reEligible`.
    </ResponseField>

    <ResponseField name="BlankTrigger" type="object">
      A placeholder trigger node with no configuration.
    </ResponseField>

    <ResponseField name="AudienceFilter" type="object">
      Filters contacts before the next step.
    </ResponseField>

    <ResponseField name="TimerAction" type="object">
      Waits before continuing. May include `amount` and `unit` (`m`, `h`, `d`, or `s`).
    </ResponseField>

    <ResponseField name="SendEmailAction" type="object">
      Sends an email. May include `emailMessageId` and `subject`. Pass the
      `emailMessageId` to [Get email message](/api-reference/get-email-message)
      and [Update email message](/api-reference/update-email-message) to read or
      edit the email's content (subject, LMX body, sender, and more).
    </ResponseField>

    <ResponseField name="ExitAction" type="object">
      Ends the workflow path for a contact.
    </ResponseField>

    <ResponseField name="BranchNode" type="object">
      Splits the workflow into conditional paths.
    </ResponseField>

    <ResponseField name="ExperimentBranchNode" type="object">
      Splits contacts into an experiment. May include `samplingRate`, `url`, `experimentId`, and `experimentType` (`webhook` or `autosplit`).
    </ResponseField>

    <ResponseField name="VariantNode" type="object">
      A variant in an experiment branch. May include `variantId` and `isControl`.
    </ResponseField>
  </Expandable>
</ResponseField>

### Error

A `400 Bad Request` is returned if `id` is invalid.

A `404 Not Found` is returned if the workflow does not exist.

If the API key is invalid (or workflow API is not enabled for your team), a
`401 Unauthorized` is returned.

<ResponseField name="message" type="string" required>
  An error message describing what went wrong.
</ResponseField>

<ResponseExample>
  ```json Response theme={"dark"}
  {
    "id": "wfl8n3q1w7x2m9k4p6r0t5y8zab2cd",
    "name": "Welcome sequence",
    "description": "Onboarding emails for new signups",
    "emoji": "👋",
    "mailingListId": null,
    "rootNodeId": "node_trigger_01",
    "nodes": {
      "node_trigger_01": {
        "typeName": "SignupTrigger",
        "nextNodeIds": ["node_timer_01"]
      },
      "node_timer_01": {
        "typeName": "TimerAction",
        "nextNodeIds": ["node_email_01"],
        "amount": 1,
        "unit": "d"
      },
      "node_email_01": {
        "typeName": "SendEmailAction",
        "nextNodeIds": ["node_exit_01"],
        "emailMessageId": "cmn5zia4i0017tzli8ric8giv",
        "subject": "Welcome to Loops"
      },
      "node_exit_01": {
        "typeName": "ExitAction",
        "nextNodeIds": []
      }
    }
  }
  ```

  ```json Error response theme={"dark"}
  {
    "message": "Workflow not found."
  }
  ```
</ResponseExample>
