# Get a Workflow Execution

Retrieves an execution with its status and outcome, its booking link, each step with the message Hero sent for it, and the appointment once booked.

Endpoint: GET /v1/workflows/{workflow_id}/executions/{execution_id}
Version: 1.0.0
Security: apiKeyAuth, practiceGroupId

## Security:

  - `apiKeyAuth` (unknown)
    apiKey in header x-api-key

  - `practiceGroupId` (unknown)
    apiKey in header x-practice-group-id

## Path parameters:

  - `workflow_id` (string, required)
    The workflow's ID, from List Workflows.

  - `execution_id` (string, required)
    The execution's ID, as returned when it was started.

## Response 200:

  - `200` (unknown)
    Ok

## Response 200 fields (application/json):

  - `id` (string, required)

  - `workflow_id` (string, required)

  - `workflow_type` (string, required)
    Enum: "booking_link", "campaign"

  - `external_reference` (string, required)

  - `patient_id` (string, required)

  - `status` (string, required)
    The state of the execution. An execution that books an appointment stays in_progress until the appointment starts. scheduled is for campaigns only, and a booking_link execution never has it: a campaign patient whose run is waiting for the campaign's sending to start. Cancel a Workflow Execution stops a campaign patient at any time while their execution is unfinished, before or after sending starts.
    Enum: "scheduled", "in_progress", "completed", "cancelled", "failed"

  - `outcome` (string, required)
    How the execution ended, such as booked or not_booked. A cancelled booking_link execution has cancelled_by_partner; cancelled (by staff) and workflow_cancelled are for campaigns only. Null while scheduled or in_progress.

  - `booking_link` (object, required)

  - `booking_link.id` (string, required)

  - `booking_link.url` (string, required)

  - `booking_link.status` (string, required)
    Enum: "unexpired", "expired"

  - `booking_link.expires_at` (string, required)

  - `steps` (array, required)

  - `steps.position` (integer, required)

  - `steps.kind` (string, required)
    Enum: "invite", "follow_up"

  - `steps.message_type` (string, required)
    How the message is sent: by SMS or email.
    Enum: "sms", "email"

  - `steps.status` (string, required)
    The state of the step.
    Enum: "scheduled", "in_progress", "completed", "skipped", "failed"

  - `steps.due_at` (string, required)

  - `steps.completed_at` (string, required)

  - `steps.failure_reason` (string, required)
    Why the step failed. Null unless status is failed.

  - `steps.message` (object, required)
    The message Hero sent for this step. Null until the step is completed.

  - `steps.message.id` (string, required)

  - `steps.message.status` (string, required)
    The delivery status of the message.
    Enum: "delivered", "declined", "sent", "pending", "retry", "fatal"

  - `steps.message.failure_reason` (string, required)

  - `appointment` (object, required)
    The appointment booked through the link. Null until one is booked.

  - `appointment.id` (string, required)

  - `appointment.start_time` (string, required)

  - `appointment.booking_status` (string, required)
    The appointment's booking status in Hero.
    Enum: "reserved", "pending", "confirmed", "cancelling", "rescheduling", "abandoned", "cancelled", "failed", "unknown"

  - `started_at` (string, required)

  - `finished_at` (string, required)

  - `created_at` (string, required)

  - `updated_at` (string, required)

## Response 401:

  - `401` (unknown)
    Unauthorised

## Response 404:

  - `404` (unknown)
    Not found

## Response 429:

  - `429` (unknown)
    Too Many Requests

## Response 500:

  - `500` (unknown)
    Unknown error

