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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# On Asana task completed

> Start an automation when a task is marked complete within an Asana resource.

`onAsanaTaskCompleted` specializes completion changes. Automate.ax fetches the task once and only emits when its current `completed` value is `true`.

```ts automations/respond-to-asana-completion.automation.ts theme={null}
import { automation } from "automate.ax"
import { addTaskComment, onAsanaTaskCompleted } from "automate.ax/asana"

export default automation("Celebrate Asana completion", () => {
  const event = onAsanaTaskCompleted({ resourceId: "project-gid" })
  addTaskComment({ taskId: event.resource.id, text: "Nice work!" })
})
```

`resourceId` is required. Optional static `account` defaults to the project binding.

Returns a task-changed event signal whose `change.field` is `"completed"` and `change.action` is `"changed"`. It remains a compact event; call `getTask` for the full task. Reopening a task does not emit this trigger.
