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

# Automation

> The workflow engine entities — Workflow, Step, Enrollment, StepRun, and the approval-gated OutreachDraft.

See the [Automation workflows](/guides/automation) guide for how these run.

| Model                | Purpose                                              | Key fields / relationships                                                                              |
| -------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `Workflow`           | Editable graph that publishes to a frozen executable | `status` (`DRAFT · LIVE · PAUSED · ARCHIVED`), `trigger_type`, `published_graph` (JSON), `reenrollment` |
| `WorkflowStep`       | A node in the draft graph                            | `kind` (`TRIGGER · ACTION · WAIT · BRANCH · MERGE`), `action_type`, `next_step`, `branch_else`          |
| `WorkflowEnrollment` | Per-contact run state (the engine's heart)           | Pins `published_graph` at enroll time; `status`, `next_run_at` (beat cursor), `idempotency_key`         |
| `WorkflowStepRun`    | Per-step execution log                               | `status` (`OK · FAILED · SKIPPED · SCHEDULED`), `result`                                                |
| `WorkflowRun`        | One execution of a workflow for a trigger            | `trigger_payload`, `action_results`, `idempotency_key`                                                  |
| `WorkflowFolder`     | Organizes workflows                                  | FK Organization                                                                                         |
| `AutomationRun`      | A metered automation execution                       | `kind`, `credits_spent`, `status`                                                                       |
| `OutreachDraft`      | Approval-gated outbound message                      | `status` (`SEEDED · APPROVED · REJECTED · SENT`); nothing sends until approved                          |

## Triggers

`contact.created`, `deal.stage_changed`, `form.submitted`, `tag.added`,
`tag.removed`, `ownership.claimed`, `affiliate.conversion`, `guest.captured`,
`ambassador.signed_up`, `schedule.daily`.

<Note>
  Enrollments pin the graph at enroll time, so editing a live workflow never changes
  in-flight runs. Generated from the `automation` app models.
</Note>
