# Write Audit Log
URL: /reference/blocks/automation-write-audit-log
Type: reference
Description: Persist an audit record for automated ticket actions
Keywords: write audit log, automation/write-audit-log, system, automation, block, workflow builder
`automation/write-audit-log` — Persist an audit record for automated ticket actions.

Where it appears [#where-it-appears]

The **Write Audit Log** block lives in the **Logic & control** group of the Workflow Builder.

Fields [#fields]

| Field           | Type                                   | Required | Default         | Description                                                                                                                                                                                                                        |
| --------------- | -------------------------------------- | -------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `actionType`    | select                                 | Yes      | `auto_response` | Category of automated action being recorded in the audit log (e.g. an auto-response was sent, a tag was added, the ticket was updated, or it was escalated). Options: `auto_response`, `tag_added`, `ticket_updated`, `escalated`. |
| `ticketId`      | text (supports references)             | Yes      | —               | ID of the ticket the audited action applies to. Use a literal ID or \<StepName.field> to reference an ID from a previous step.                                                                                                     |
| `ticketSubject` | text (supports references)             | No       | —               | Optional ticket subject stored with the audit record for context. Accepts literal text or \<StepName.field>.                                                                                                                       |
| `responseText`  | text (multi-line, supports references) | No       | —               | Optional response text to record with the audit entry (e.g. the message that was sent). Accepts literal text or \<StepName.field>.                                                                                                 |

Inputs and outputs [#inputs-and-outputs]

Inputs are the configurable fields above. The block produces these outputs:

**Outputs**

Reference an output downstream with `<Write Audit Log.field>`.

| Name         | Type    | Description             |
| ------------ | ------- | ----------------------- |
| `success`    | boolean | Success status          |
| `auditLogId` | string  | Audit log ID            |
| `error`      | string  | Error message if failed |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "automation/write-audit-log",
  "config": {
    "actionType": "auto_response",
    "ticketId": "<PreviousStep.field>"
  }
}
```

Limits and failure modes [#limits-and-failure-modes]

* Required fields (`actionType`, `ticketId`) must be set, or the block fails validation before it runs.
* On failure the `error` output is populated; downstream blocks that reference other outputs may not receive values.

Related [#related]

* [All workflow blocks](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)