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

# Get a workflow

> Returns a single workflow with its steps



## OpenAPI

````yaml /openapi.json get /workflows/{workflowId}
openapi: 3.1.0
info:
  title: subscriber.dev API
  description: >-
    Trigger workflows, manage subscribers and send broadcasts. Authenticate with
    an API key in the X-API-Key header: the key decides the environment. Docs:
    https://docs.subscriber.dev
  version: '1.0'
  contact: {}
servers:
  - url: https://api.subscriber.dev
    description: Cloud
security: []
tags: []
paths:
  /workflows/{workflowId}:
    get:
      tags:
        - Workflows
      summary: Get a workflow
      description: Returns a single workflow with its steps
      operationId: getWorkflow
      parameters:
        - name: workflowId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetailResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited. Wait a second and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer: []
        - api-key:
            - workflows:read
components:
  schemas:
    WorkflowDetailResponse:
      type: object
      properties:
        publicId:
          type: string
        key:
          type: string
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        status:
          type: string
          enum:
            - active
            - paused
        type:
          type: string
          enum:
            - automation
            - broadcast
        channels:
          type: object
          properties:
            email:
              type: object
              properties:
                fromName:
                  type: string
                replyTo:
                  type: string
          description: Settings for each channel this workflow sends on.
        steps:
          type: array
          items:
            type: object
            properties:
              publicId:
                type: string
              stepOrder:
                type: number
              type:
                type: string
              delayMs:
                type: number
              subject:
                type: string
              body:
                type: string
              layout:
                description: >-
                  Email steps only. Steps saved before layouts existed have no
                  value and use "default".
                type: string
                enum:
                  - default
                  - none
              previewText:
                description: Email steps only.
                type: string
              url:
                description: >-
                  Webhook URL, redacted to origin + last 4 characters since it
                  usually contains a secret. Sending the redacted value back in
                  an update keeps the stored URL.
                type: string
            required:
              - publicId
              - stepOrder
              - type
              - delayMs
        triggers:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
                minLength: 1
                description: Connected integration that fires the trigger, e.g. "stripe".
              event:
                type: string
                minLength: 1
                maxLength: 255
                description: >-
                  One of the source's events (see list_trigger_sources), e.g.
                  "trial_started", or a raw event type such as
                  "checkout.session.completed".
              label:
                type: string
                description: Human-readable name of the event.
              active:
                type: boolean
                description: >-
                  False while the source's integration is disconnected; it
                  resumes once it's reconnected.
            required:
              - source
              - event
              - label
              - active
        exitConditions:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
                minLength: 1
                description: Connected integration that fires the trigger, e.g. "stripe".
              event:
                type: string
                minLength: 1
                maxLength: 255
                description: >-
                  One of the source's events (see list_trigger_sources), e.g.
                  "trial_started", or a raw event type such as
                  "checkout.session.completed".
              label:
                type: string
                description: Human-readable name of the event.
              active:
                type: boolean
                description: >-
                  False while the source's integration is disconnected; it
                  resumes once it's reconnected.
            required:
              - source
              - event
              - label
              - active
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
        updatedAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
        editUrl:
          description: >-
            Link to edit this workflow's emails in the web editor. Share it when
            someone wants to tweak the copy or preview an email.
          type: string
        sentCount:
          type: number
        failedCount:
          type: number
        skippedCount:
          type: number
        pendingCount:
          type: number
        bouncedCount:
          type: number
        hardBounceCount:
          type: number
        softBounceCount:
          type: number
        successRate:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - publicId
        - key
        - name
        - description
        - status
        - type
        - channels
        - steps
        - triggers
        - exitConditions
        - createdAt
        - updatedAt
        - sentCount
        - failedCount
        - skippedCount
        - pendingCount
        - bouncedCount
        - hardBounceCount
        - softBounceCount
        - successRate
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        message:
          type: string
          example: Workflow not found
        error:
          type: string
          example: Not Found
        errors:
          description: Which fields failed validation, on a 400.
          type: array
          items:
            type: object
            properties:
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              message:
                type: string
              code:
                type: string
            required:
              - path
              - message
      required:
        - statusCode
        - message
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
      description: >-
        A session token from `subscriber login`, used by subscriber.dev's own
        apps. Requests about an environment also need its ID in the
        `x-environment-id` header. From your own code, use an API key.
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: An environment API key. Keep it on your server.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.