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

# n8n

> Export Audity deliverables to n8n and wire Audity webhook events into automated workflows.

Audity integrates with [n8n](https://n8n.io) in two ways: a one-click **n8n export** from the deliverables hub that packages audit output as structured data for your workflows, and a **webhook trigger** that fires n8n workflows in real time when Audity events occur.

## Requirements

* **Solo, Team, or Enterprise** plan
* n8n self-hosted or n8n Cloud
* An Audity Personal Access Token (`aky_...`), see [Authentication](/authentication) in the API docs

***

## Option A: Export deliverables to n8n

Use the n8n export to pull structured audit deliverables into a workflow for downstream processing, CRM updates, report generation, Slack summaries, and more.

### Export from the deliverables hub

<Steps>
  <Step title="Open the deliverables hub">
    In your audit project, click **Deliverables** in the left navigation.
  </Step>

  <Step title="Find the n8n export card">
    Locate the **n8n** card in the integrations row. Click **Export to n8n**.
  </Step>

  <Step title="Copy the payload">
    Audity generates a structured JSON payload containing your deliverable sections (executive summary, findings, recommendations). Copy the payload or download it as a `.json` file.
  </Step>

  <Step title="Import into n8n">
    In n8n, use an **HTTP Request** node or paste the JSON into a **Code** node. Map the fields to the downstream nodes in your workflow.
  </Step>
</Steps>

### Deliverables export payload shape

```json theme={null}
{
  "projectId": "proj_abc123",
  "clientName": "Acme Corp",
  "exportedAt": "2025-05-01T15:00:00Z",
  "deliverables": {
    "executiveSummary": "...",
    "findings": [...],
    "recommendations": [...]
  }
}
```

***

## Option B: Trigger n8n workflows via webhooks

Use Audity [webhooks](/guide/integrations/webhooks) to fire an n8n **Webhook** trigger node the moment a survey is completed or an analysis is generated.

### Wire an Audity webhook to n8n

<Steps>
  <Step title="Create a webhook trigger node in n8n">
    Open your n8n workflow and add a **Webhook** node as the trigger. Set the method to `POST`. Copy the production webhook URL (e.g. `https://your-n8n.example.com/webhook/abc123`).
  </Step>

  <Step title="Register the URL in Audity">
    In the Audity app, go to **Dashboard → Settings → Webhook**. Paste the n8n webhook URL. Select the events you want to receive (`survey_completed`, `analysis_generated`, or both). Save.
  </Step>

  <Step title="Activate the n8n workflow">
    Toggle the workflow to **Active** in n8n. Inactive workflows reject incoming webhook deliveries.
  </Step>

  <Step title="Test the integration">
    Complete a test survey in Audity. The n8n execution log should show a new run with the Audity payload within seconds.
  </Step>
</Steps>

### Accessing payload fields in n8n

The Audity webhook delivers a JSON body. In n8n nodes downstream of the Webhook trigger, reference fields using expressions:

```
{{ $json.event }}              // "survey_completed"
{{ $json.data.projectId }}     // "proj_abc123"
{{ $json.data.clientName }}    // "Acme Corp"
{{ $json.data.completedAt }}   // "2025-05-01T14:31:58Z"
```

See the full payload schema in the [Webhooks reference](/guide/integrations/webhooks).

***

## Example workflow: post a Slack summary when an analysis is ready

```
Webhook trigger (analysis_generated)
  → HTTP Request (GET /api/projects/{{$json.data.projectId}}/audit-analysis)
  → Code node (extract top 3 recommendations)
  → Slack (post to #client-updates: "Analysis ready for {{$json.data.clientName}}")
```

<Note>
  The audit analysis endpoint may take up to 5 minutes to return results for large projects. If you need the full analysis in your workflow, add a **Wait** node or poll with a **Loop** node before proceeding.
</Note>

***

## Example workflow: update a CRM contact when a survey is completed

```
Webhook trigger (survey_completed)
  → HTTP Request (GET /api/projects/{{$json.data.projectId}})
  → HubSpot / Salesforce node (find contact by clientName)
  → HubSpot / Salesforce node (update contact: surveyStatus = 'completed')
```

***

## Tips for consulting teams

* **Use one PAT per n8n instance.** If a workflow leaks, you only revoke one token.
* **Return `200` immediately.** Do all heavy processing in downstream nodes after the Webhook trigger, Audity requires a response within 10 seconds or it marks the delivery as failed and retries.
* **Check the Audity delivery log.** Go to **Settings → Webhook** to view delivery history and replay failed deliveries without re-triggering the original event.
* **Version your workflows.** n8n supports workflow versioning; tag versions that correspond to breaking changes in the Audity payload format.

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Audity shows WEBHOOK_TIMEOUT but n8n received the request">
    Your n8n workflow is taking more than 10 seconds to return a response. Move all processing to nodes after the initial Webhook response, or enable **Respond Immediately** in the Webhook node settings.
  </Accordion>

  <Accordion title="n8n webhook URL rejected by Audity">
    Audity requires HTTPS. Make sure your n8n instance is accessible over HTTPS (not plain HTTP). If you're self-hosting, confirm your reverse proxy terminates TLS correctly.
  </Accordion>

  <Accordion title="Workflow doesn't trigger">
    Verify the workflow is **Active** in n8n (not just saved). Also confirm the correct event is selected in Audity's webhook settings.
  </Accordion>

  <Accordion title="WEBHOOK_DELIVERY_FAILED after 3 retries">
    Check your n8n instance logs for the failed request. Fix the underlying error (unreachable host, crashing workflow, etc.), then replay the delivery from **Settings → Webhook** in Audity.
  </Accordion>
</AccordionGroup>

## What's next

* [Webhook payload reference →](/guide/integrations/webhooks)
* [Export a Gamma deck from deliverables →](/guide/integrations/gamma)
