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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message`, the default import of the v7 Node SDK. Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Automation Debugger

> Step through a run to see what each node received and what it returned.

# Automation Debugger

Courier's automation debugging tool can be used to run a test event through your automation template and debug any errors you may come across.

## Creating a Test Run Context

Similar to notification templates, automations can now be tested with test run contexts passed in and saved as test events. These tests can mimic an incoming payload passed through [Segment](/docs/journeys/automations/segment), [inbound events](/docs/journeys/automations/inbound-events), or an [adhoc automation call](/docs/journeys/automations/steps). You can create a test event from the `Debug` tab in your automation template.

<Frame caption="Automation Test Event">
  <img src="https://mintcdn.com/courier-4f1f25dc/WNdu5qn7yJu4418-/assets/platform/automations/debugger.png?fit=max&auto=format&n=WNdu5qn7yJu4418-&q=85&s=fb8ce99f2619ef29b59478d09a824569" alt="Automation Test Event" width="2860" height="1418" data-path="assets/platform/automations/debugger.png" />
</Frame>

## Running The Test Run Context

With your automation test event configured, you can execute a test run through the debugging tool to simulate the event passed through the automation workflow. When ready, click on the `Run Again` button and select each node to see the data being passed.

<Frame caption="Test Event Trigger">
  <img src="https://mintcdn.com/courier-4f1f25dc/WNdu5qn7yJu4418-/assets/platform/automations/debug-trigger.png?fit=max&auto=format&n=WNdu5qn7yJu4418-&q=85&s=5f1eaa92ee45e147420dc3935158d4f0" alt="Test Event Trigger" width="2036" height="1078" data-path="assets/platform/automations/debug-trigger.png" />
</Frame>

### Verifying Test Data

After running your simulated run, you can select each node in your workflow to verify that the data is passed through to each consecutive node. This can be helpful if you have several nodes that rely on incoming data payloads.

<Frame caption="Data Passed to Each Node">
  <img src="https://mintcdn.com/courier-4f1f25dc/WNdu5qn7yJu4418-/assets/platform/automations/debug-check.png?fit=max&auto=format&n=WNdu5qn7yJu4418-&q=85&s=4336dfc95f4afb1d833ec1ee9878bac2" alt="Data Passed to Each Node" width="2018" height="1044" data-path="assets/platform/automations/debug-check.png" />
</Frame>

## Run your Automation

After testing with the debugger, invoke your automation via API with the data payload you want to pass.

`POST https://api.courier.com/automations/:template_id/invoke`

```json theme={null}
{
  "data": {
    "order_id": "ORD-12345",
    "status": "shipped"
  },
  "profile": {
    "email": "sarah@acme-corp.com",
    "phone_number": "+12345678910",
    "name": "Jane"
  }
}
```

The automation run context shows a successful run with the data you passed.

<Frame caption="Successful Run Context">
  <img src="https://mintcdn.com/courier-4f1f25dc/WNdu5qn7yJu4418-/assets/platform/automations/debug-success.png?fit=max&auto=format&n=WNdu5qn7yJu4418-&q=85&s=05a80cd6752db862f59a76d300ecb518" alt="Successful Run Context" width="1830" height="1140" data-path="assets/platform/automations/debug-success.png" />
</Frame>

## Testing GET Profile Nodes

Use the debugger to test a [GET Profile](/docs/journeys/automations/get-profile) node before promoting your template to production. The debugger shows the run context passed down your automation after fetching a profile.

<Frame caption="GET Profile Node">
  <img src="https://mintcdn.com/courier-4f1f25dc/WNdu5qn7yJu4418-/assets/platform/automations/get-profile-node.png?fit=max&auto=format&n=WNdu5qn7yJu4418-&q=85&s=a32ec4020d914b988eed9eae6fd0b47f" alt="GET Profile Node" width="1894" height="858" data-path="assets/platform/automations/get-profile-node.png" />
</Frame>
