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

# Automations

> Validate, save, publish, and enroll GreenTick workflows from an assistant.

An automation runs on every WhatsApp number on the account. Do not attach a phone number, and an empty phoneNumberRef is expected. The assistant saves a draft first. It publishes or enrolls only after you ask.

## Order of calls

**1. Read the catalog**

`get_workflow_catalog` lists starter workflows. `create_workflow_from_template` copies one by `templateSlug` and `name`. The copy is a draft.

**2. Validate**

`validate_workflow` checks the steps and does not save them. The first step must be a trigger: `message_received`, `webhook`, or `campaign_enrolled`. Name, description, text, and caption must fit `get_limits`.

**3. Save the draft**

`create_workflow` or `update_workflow` stores the draft. A draft blocks `enroll_automation` until `publish_workflow` succeeds. `list_workflows` and `get_workflow` show draft and published status.

**4. Publish**

`publish_workflow` runs only after you ask, and it switches the workflow on. Pass `isActive: false` to publish it and leave it off. `set_workflow_active` switches a published workflow on or off. A validation error stays on `publish_workflow`. The assistant does not enroll the workflow to get around it.

**5. Enroll**

`list_automations` returns published automations that are switched on. `enroll_automation` takes `contacts`, up to 100 items of `{ to, phoneNumberRef }`. A draft says the workflow is a draft. A published workflow that is switched off says it is switched off.

`discard_workflow_draft` drops unpublished edits. `delete_workflow` deletes the workflow and its execution history, and only after you ask. `export_workflows` exports up to 50 workflows by id. `get_workflow_analytics` reads one workflow's analytics.

`get_workflow_catalog` returns `messageTypes` and `actionTypes`. Those are the same choices as the builder.

Message nodes: `send_text`, `send_media`, `send_audio`, `ask_question`, `send_template`, `send_flow`, `send_catalog`, `send_interactive_list`, `send_interactive_buttons`, `send_cta_url`, `send_interactive_carousel`.

Action nodes: `add_label`, `remove_label`, `update_attribute`, `assign_team`, `assign_user`, `assign_bot`, `opt_out_broadcast`, `wait`. `trigger_workflow` runs in the engine and is hidden in the builder.

`add_label` and `remove_label` take a label id from `list_labels` or the label's name. A missing label fails the run. A WhatsApp send that cannot be delivered, including a number that is not on WhatsApp, fails the run instead of showing completed. An unknown step type is rejected instead of being skipped.

Drip campaigns in the dashboard only list workflows whose trigger is `campaign_enrolled`. A `message_received` workflow does not appear there.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.