# Automations

Answer comments with DMs, run conversation workflows, send drip sequences and broadcasts, and set up the prompts people see when they open a chat.

Automations act on your messaging accounts without someone at the keyboard. Pozy has five building blocks. They share [contacts](https://pozy.ai/docs/inbox/contacts), tags and [custom fields](https://pozy.ai/docs/inbox/custom-fields), so a tag set by one is visible to the others.

| You want to | Use | Platforms |
| --- | --- | --- |
| DM everyone who comments a keyword under a post | [Comment to DM](https://pozy.ai/docs/automations/comment-to-dm) | Instagram, Facebook (public replies on TikTok, Threads, LinkedIn, YouTube) |
| Run a conversation: ask questions, branch on answers, call your backend, hand off to a person | [Workflows](https://pozy.ai/docs/automations/workflows) | WhatsApp, Instagram, Facebook, X, Bluesky, TikTok |
| Send a series of messages over days to people who opted in | [Sequences](https://pozy.ai/docs/automations/sequences) | WhatsApp, Instagram, Facebook, X, Bluesky, Slack |
| Send one message to many contacts at once, now or later | [Broadcasts](https://pozy.ai/docs/automations/broadcasts) | WhatsApp, SMS, Instagram, Facebook, X, Bluesky, Slack, iMessage |
| Show prompts, menus and a greeting when someone opens a chat | [Conversation starters](https://pozy.ai/docs/automations/conversation-starters) | Facebook, Instagram, WhatsApp |

## How they connect

```text
Comment "guide" on a reel
  -> comment automation sends a DM with a button       (comment to DM)
  -> tap starts a workflow: asks for an email, tags     (workflows)
  -> workflow enrolls the contact in a 3-step sequence  (sequences)
  -> later, a product launch reaches every "guide" tag  (broadcasts)
```

- A button or menu item whose payload is `pozy:workflow:<workflowId>` starts that workflow when tapped. It works from comment automation DMs, persistent menus, ice breakers and the Get Started button.
- A workflow's `enroll_sequence` node puts the contact into a sequence.
- `add_tag`, `remove_tag` and `set_field` nodes write to the contact, and broadcasts target contacts by those tags and fields.

## Rules every automation follows

**Platform messaging windows apply.** On Instagram and Facebook, automated messages can only go out within 24 hours of the person's last message. The `HUMAN_AGENT` tag that extends the window is for replies typed by a person and is rejected on automated sends. On WhatsApp, anything outside the 24-hour window must be an approved template. See [Messages](https://pozy.ai/docs/inbox/messages#messaging-windows).

**Automations answer before workflows.** When an active comment automation matches a comment, it answers and a comment-triggered workflow does not start. The same goes for story replies and story mentions.

**A thread owned by another app is left alone.** Messages that arrive while another app owns the conversation (`metadata.standby: true`) start nothing. See [handover](https://pozy.ai/docs/inbox/messages#hand-a-conversation-to-another-app).

**Every send is attributed.** `message.sent` webhooks carry `sentVia` (`workflow`, `sequence`, `broadcast`, `comment_automation`) plus `workflowId` and `executionId`, `sequenceId`, `broadcastId` or `automationId`. Use them to credit replies and conversions to the automation that earned them.

**Outbound messages are metered.** Messages sent by automations count toward your outbound messages, with a free monthly allowance. See [Pricing](https://pozy.ai/docs/billing).

## Webhook events

| Event | When it fires |
| --- | --- |
| [`contact.tag_added`](https://pozy.ai/docs/webhooks/events#contact-tag-added) | Contact tag added. |
| [`contact.tag_removed`](https://pozy.ai/docs/webhooks/events#contact-tag-removed) | Contact tag removed. |
| [`contact.field_changed`](https://pozy.ai/docs/webhooks/events#contact-field-changed) | Contact field changed. |
| [`sequence.enrolled`](https://pozy.ai/docs/webhooks/events#sequence-enrolled) | Sequence enrolled. |
| [`sequence.exited`](https://pozy.ai/docs/webhooks/events#sequence-exited) | Sequence exited. |
| [`workflow.run.started`](https://pozy.ai/docs/webhooks/events#workflow-run-started) | Workflow run started. |
| [`workflow.run.completed`](https://pozy.ai/docs/webhooks/events#workflow-run-completed) | Workflow run completed. |
| [`workflow.run.failed`](https://pozy.ai/docs/webhooks/events#workflow-run-failed) | Workflow run failed. |
