> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Steps Canonical URL: https://posthog.com/docs/workflows/automations/steps ## On this page - [Send](#send) - [Wait](#wait) - [Branch](#branch) - [Act in PostHog](#act-in-posthog) - [AI](#ai) - [Settings on every step](#settings-on-every-step) - [Use results in later steps](#use-results-in-later-steps) After the trigger, add steps to send, wait, branch, and act. Click **+** between two steps, or use **Add a step or run a command** at the bottom of the canvas, to open the step list. ![The menu of steps you can add to an automation](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/automation_add_step_light_5e168112df.png) ## Send | Step | What it does | | --- | --- | | **Email** | Sends an email that you write in the [email editor](https://posthog.com/docs/workflows/email-editor.md). | | **SMS** | Sends a text message through Twilio. See [SMS](https://posthog.com/docs/workflows/automations/slack-sms-webhooks.md#sms). | | **Slack** | Posts a message to a Slack channel. See [Slack](https://posthog.com/docs/workflows/automations/slack-sms-webhooks.md#slack). | | **Webhook** | Sends a request to a URL, such as your own API. | | **Push** | Sends a [push notification](https://posthog.com/docs/workflows/push.md) to the person's devices. | | **More** | Sends to one of PostHog's other [destinations](https://posthog.com/docs/data-pipelines/destinations.md), such as a CRM. | The **Email** step has these settings: - **Message category:** lets people opt out of this kind of email. See [opt-outs](https://posthog.com/docs/workflows/email/opt-outs.md). - **Track opens and link clicks:** on by default. See [link tracking](https://posthog.com/docs/workflows/email/link-tracking.md). - **Add UTM tags to links:** off by default. - **Skip the frequency cap:** for emails people need on time, such as a welcome email. Opt-outs still apply. See [frequency cap](https://posthog.com/docs/workflows/email/frequency-cap.md). ## Wait | Step | What it does | | --- | --- | | **Delay** | Waits a set time, such as 2 days, or until a date on the person or event, such as 1 day before `trial_ends_at`. | | **Time window** | Waits for the next allowed time, such as weekdays from 9 to 5, in a time zone you pick or the person's own. | | **Wait until** | Waits until the person does an event or matches a property condition, up to a **Max time to wait**. It has one path for a match, and one for the time limit. | A **Delay** for a set time can last up to 365 days. **Max time to wait** on a **Wait until** step can be up to 30 days. Smaller units stop at 24 hours, 60 minutes, and 60 seconds, so 90 minutes counts as 60 minutes. A **Delay** until a date works like this: - A date in the past continues right away. - A date that's missing or can't be read ends the run, whatever the step's **Error handling** says. - If the date moves later while the run waits, the wait follows it. If it moves earlier, the wait still ends on the original date. - By default, the run waits at most 30 days past the step, then continues. Set `max_delay_duration` on the step through the API to change this limit. A **Wait until** step resumes only for events from the person in that run. Its filters use fixed values. It can't match an event to a property of the trigger event, such as the same `order_id`. ![A Wait until step with its condition and time limit](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/automation_wait_until_light_7c1eaafdd8.png) ## Branch | Step | What it does | | --- | --- | | **Conditional branch** | Splits people by person properties, event properties, cohorts, or variables. Conditions are checked from top to bottom, and the first match sets the path. People who match no condition take the last path. | | **Cohort branch** | Splits people at random by percentage, such as 50/50, to test two versions. | ![A branch step that sends people down different paths](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/automation_branch_light_3d866402a5.png) ## Act in PostHog | Step | What it does | | --- | --- | | **Set variable** | Saves a value for later steps. | | **Capture event** | Records an event, to start another automation or to measure this one in insights. | | **Update person property** | Sets a person property, such as `onboarding_stage`. | | **Set group property** | Sets a property on a group. | | **Add to static cohort** | Adds the person to a static cohort. | | **Opt out of messages** | Opts the person out of a message category, or of all marketing messages. | The **Support** section has **Get ticket**, **Update ticket**, and **Send message** steps for [support](https://posthog.com/docs/support/workflows.md) tickets. ## AI Start an AI task, run a scout, or have Replay Vision watch the person's session. Then branch on the answer. See [AI steps](https://posthog.com/docs/workflows/automations/ai-steps.md). ## Settings on every step Below its main settings, each step has: - **Conditions:** the step runs only for people who match. Everyone else skips to the next step. Branch steps and **Wait until** don't have this. - **Output variables:** saves the step's result for later steps. See below. - **Error handling:** what happens when the step fails, such as when a message can't be sent. **Continue to next step** is the default for most steps. **Opt out of messages** defaults to **Exit the workflow**, so a failed opt-out never reaches a message step. **Exit the workflow** ends the run. ![The Error handling setting on a step, with Continue to next step and Exit the workflow](https://res.cloudinary.com/dmukukwp6/image/upload/w_800,c_limit,q_auto,f_auto/error_handling_28a45d2ecf.png) ## Use results in later steps Save part of a step's result as a variable, such as the ID that a webhook returns: 1. Open **Output variables** on the step. 2. Pick a variable, or type a name to create one, and pick its type. 3. Set **Result path** to the part you need, such as `body.id`. Leave it empty to save the whole result. Later steps read the variable as `{variables.ticket_id}`, such as in a webhook or a Slack message. In an email, use Liquid: `{{ variables.ticket_id }}`. A branch can also split on it. All of a run's variables together must fit in 5 KB, so save only the fields you need. See [email and automation limits](https://posthog.com/docs/workflows/reference/limits.md#email-and-automation-limits) for the other limits on a run.