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

# Triggers and actions

> What each workflow step does, what it needs from you, and the AI agent that does the writing.

A workflow is one trigger followed by actions. Select a step in the builder to configure it.

## Triggers

The trigger is what starts a run. Each workflow has exactly one, set when you created it from an example.

| Trigger               | Fires when                        | You configure                                 |
| --------------------- | --------------------------------- | --------------------------------------------- |
| **Schedule**          | A set interval comes round        | **Run every** — how often                     |
| **New RSS item**      | A new item appears in a feed      | **RSS feed URL**                              |
| **Product published** | You publish a WooCommerce product | **Pick store**                                |
| **New webhook**       | A URL is visited or called        | Nothing — Ocoya gives you the **Webhook URL** |
| **New comment**       | Someone comments on a chosen post | **Social profile**, then the **Post**         |
| **New mention**       | Someone mentions you              | **Social profile**                            |
| **New DM**            | A DM arrives                      | **Social profile**                            |

Three details worth knowing:

* **RSS is checked every 1–2 hours**, not continuously. Feeds update infrequently enough that polling harder would gain nothing, so don't expect a post within minutes of an article going up.
* **WooCommerce fires only the first time a product goes live**, and can be delayed by up to 5 minutes. Editing a published product won't trigger it again.
* **New comment watches one specific post**, not everything you publish. Pick the post when you set it up.

The last three triggers read from the Inbox, so they cover **Facebook and Instagram only**.

## Actions

| Action                 | What it does                             | You configure                                        |
| ---------------------- | ---------------------------------------- | ---------------------------------------------------- |
| **Use AI agent**       | Generates text (and optionally an image) | The agent, plus the **Text input** it works from     |
| **Create social post** | Publishes or drafts a post               | **Caption**, **Behavior**, optional image URLs       |
| **Reply in comments**  | Comments back                            | **Reply text**                                       |
| **Send DM**            | Sends a direct message                   | **DM message**, optional attachment                  |
| **Filter**             | Stops the run unless a condition holds   | **Only continue if** — contains, or does not contain |
| **Delay**              | Waits before the next step               | **Delay for**                                        |

**Filter** is the one that makes engagement workflows precise. Its conditions are *Contains* and *Does not contain*, both case-insensitive, which is how the Comment-to-DM example replies only to comments carrying your keyword rather than every comment on the post.

Steps pass values down the chain — an AI agent's generated text becomes the caption of the post that follows it, for example, rather than you retyping it.

## The AI agent

Most examples include **Use AI agent**, and it's where the actual writing happens. You pick an agent, or create one from inside the step.

An agent holds:

* **Agent name**
* **Prompt** — its standing instructions, the equivalent of a brief
* **LLM** — which model it runs on
* **Image generation** — on or off
* **Web search** — on or off

The prompt is what makes an agent good or useless. *Write a social post* produces filler. Something that says what the brand does, who it's for, what to avoid and how long the post should be produces something you'd publish.

There's a **Test** button so you can try an agent's output before switching the workflow on. A test costs 1 credit, which is a great deal cheaper than discovering the problem across thirty live runs.

<Note>
  An agent belongs to your brand, so one good agent can be reused across several workflows. Improving its prompt improves every workflow that uses it.
</Note>

## Credits

The **run** costs 1 credit, and that covers the whole chain — the AI agent's work included. A workflow with four steps costs the same as one with two.

Testing an agent costs 1 credit per test. See [What are credits?](/help/credits)

## Related

<Columns cols={2}>
  <Card title="Create a workflow" icon="plus" href="/help/create-a-workflow">
    Picking the example that gives you the right steps.
  </Card>

  <Card title="Inbox" icon="inbox" href="/help/inbox">
    Why comment, mention and DM triggers are Facebook and Instagram only.
  </Card>
</Columns>
