# Get a Run Step

Inspect one step of a run: the exact data it received and the exact data it returned.

`GET https://connect.mindcloud.co/v2/runs/:runId/steps/:stepInstanceId`

Permissions: `log:view`.

## Parameters

### Path

- `runId` (string, required): The run's id, from List Runs.
- `stepInstanceId` (string, required): The step instance id, from List Run Steps.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request GET \
  --url 'https://connect.mindcloud.co/v2/runs/Rm4pQ7sJt1Ve/steps/Sx4jK9mP2wRd' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `stepInstanceId` (string): Unique id of this step execution.
- `stepId` (string): The step in the workflow definition.
- `actionId` (string): The action the step ran.
- `success` (boolean): True if the step succeeded.
- `ran` (boolean): True if the step executed. False for the first step of an If/Else branch the run did not take, shown when the other branch of that If/Else ran; a branch with no steps is a placeholder whose stepId is null.
- `request` (object): The exact data the step received. Its shape depends on the action. The connection it ran with appears as a reference, never its secrets: `connectionId` (for Get Connection; null when that connection no longer exists), `authenticationId`, `type` and `label`.
- `response` (object): The exact data the step returned: { success, message, data, meta }. data depends on the action and the provider.
  - `success` (boolean): True when the step succeeded.
  - `message` (string): Failed steps: what went wrong, for a person (also meta.message).
  - `data` (object): The step's records: an array whose shape depends on the action and the provider.
  - `meta` (object): About the run of the step. The keys below are the runtime's; a step type or an app's response mapper may add others.
    - `action` (object): The action that ran, when the step runs one: its id, slug and operation, and the query, body and params it was called with.
      - `id` (string): The action's id.
      - `slug` (string): The action's slug.
      - `operation` (string): read, create, update or delete.
    - `request` (object): What the step sent, redacted: the connection it ran with is a reference (connectionId for Get Connection, null when that connection is gone; authenticationId, type, label), never its secrets.
    - `response` (object): The provider's answer around the data, such as its status and headers, redacted.
    - `code` (string): Failed steps: why, UPPER_SNAKE (API_RESPONSE_MAPPER_MISSING_PROPERTIES, ...).
    - `message` (string): Failed steps: what went wrong, for a person.
    - `size` (number): Successful steps: the size of what the step returned, in MB.
    - `createdOn` (date): When the app step answered.
    - `warnings` (array): Problems that did not fail the step, each { code }.
      - `code` (string): What happened, UPPER_SNAKE.
    - `paginationIgnored` (string): Set when the step's paging settings were not applied: actionPaginationInactive, the action does not page.
    - `drainStopReason` (string): A step reading every page: why it stopped before the last one.

## Errors

- 404 Run, output, or step not found (NOT_FOUND, RUN_OUTPUT_NOT_FOUND): `NOT_FOUND` "Step "Sx4jK9mP2wRd" was not found in run "Rm4pQ7sJt1Ve"."
- 409 Run output unavailable: `CONFLICT` / `RUN_OUTPUT_UNAVAILABLE` "The final output for run "Rm4pQ7sJt1Ve" is not available."
- 413 Run output too large: `PAYLOAD_TOO_LARGE` / `RUN_OUTPUT_TOO_LARGE` "Run output for "Rm4pQ7sJt1Ve" is too large to serve through this endpoint."
- 502 Run output could not be loaded: `PROVIDER_ERROR` / `RUN_OUTPUT_UNAVAILABLE` "Run output for "Rm4pQ7sJt1Ve" could not be loaded."
