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

# Deploy a flow

> Activate a flow so real users can talk to it — and undeploy it cleanly when you need to.

A flow goes through three statuses: **draft** → **active** → **archived**. Deploy is what moves it from draft to active.

## What deploy actually does

For a **Responder** flow:

1. The platform validates every channel's configuration.
2. For each valid channel, a listener is scheduled. Gmail/Outlook listeners start polling the inbox. Slack/Teams listeners subscribe to events. Phone numbers go live.
3. The flow's status flips to `active`. The toolbar's button becomes **Undeploy**.

For an **Initiator** flow:

1. Channels are validated (no listeners scheduled — initiator flows don't poll).
2. The status flips to `active`.
3. The **Start Conversation** button becomes usable. Workflow nodes that reference this flow can now invoke it.

## Deploying

<Steps>
  <Step title="Check the flow is ready">
    * At least one actor exists.
    * The routing topology makes sense (every actor reachable from Start).
    * For Responder mode: at least one channel configured.
    * All required integration connections are active.
  </Step>

  <Step title="Click Deploy">
    In the bottom toolbar.

    <Note>
      If validation fails, the deploy is rejected with a clear error — usually a missing connection or required field on a channel. Fix the issue and click Deploy again.
    </Note>
  </Step>

  <Step title="Verify the status badge">
    The header badge changes from `draft` to `active`. The toolbar button now reads **Undeploy** (or, for Initiator flows, **Start Conversation**).
  </Step>
</Steps>

## Editing a deployed flow

You can edit a deployed flow in place:

* **Actor prompts** — changes apply on the next actor turn. No redeploy needed.
* **Adding a new actor or edge** — applies immediately.
* **Global context** — applies on the next actor turn.
* **Knowledge bases and capabilities** — applies immediately.

You don't need to undeploy to iterate.

What *does* require redeploy:

* Adding, removing, or changing **channel configuration**. The listener has to be re-scheduled.
* Changing the flow's **execution mode** (Responder ↔ Initiator).

The Deploy button shows a "stale" indicator when a redeploy is needed.

## Undeploying

Click **Undeploy** in the toolbar. The platform:

1. Stops all channel listeners (no more inbound messages will be picked up).
2. Closes pending background work cleanly.
3. The flow's status flips to `draft`.

In-progress conversations **are not interrupted**. They continue handling existing sessions to completion, then no new ones are opened.

## What happens to running conversations

| Operation               | Effect on in-flight conversations                                       |
| ----------------------- | ----------------------------------------------------------------------- |
| Edit a prompt           | Picked up on the next turn.                                             |
| Edit global context     | Picked up on the next turn.                                             |
| Change a channel config | New sessions use the new config; existing sessions keep their snapshot. |
| Undeploy                | Existing sessions continue to completion; new sessions are not started. |
| Archive                 | Same as undeploy. The flow is hidden from the main list.                |

## Mode-specific notes

### Responder

Listeners poll continuously while deployed. The polling cadence is per-channel:

* Email: every \~minute.
* Slack, Teams: event-driven (push from Slack/Teams).
* Phone: event-driven via Twilio.

If a listener fails (e.g. credentials expired), the channel shows a red badge in the editor. You don't lose inbound messages once credentials are fixed and the flow is redeployed — the listener resumes from where it left off.

### Initiator

No listeners run. The deploy step exists mainly to validate configuration. Once active:

* The **Start Conversation** button is enabled.
* Workflow nodes that reference the flow can invoke it.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Deploy fails with 'channel needs re-binding'" icon="circle-exclamation">
    The shared test phone number you were using has been released (lease expired or the workspace lost it). Add a new phone number in **Phone Numbers** and reconfigure the channel.
  </Accordion>

  <Accordion title="Deploy fails with 'connection inactive'" icon="circle-exclamation">
    The integration connection (Gmail, Slack, etc.) has been revoked or expired. Go to **Integrations**, reauthorise, then redeploy.
  </Accordion>

  <Accordion title="A channel has a red badge" icon="circle-exclamation">
    Listener has been failing repeatedly — likely an authentication issue. Re-check the connection, save the channel, redeploy.
  </Accordion>

  <Accordion title="Inbound messages aren't appearing as conversations" icon="circle-question">
    Check:

    * Flow status is `active`.
    * The channel for that source is configured *and* deployed.
    * Filters (email label, Slack scope) match the inbound traffic.
    * In Conversations history, look for the conversation by sender — it might be there but you missed the notification.
  </Accordion>
</AccordionGroup>

## Next

<CardGroup cols={2}>
  <Card title="Start a conversation" icon="paper-plane" href="/conversation-flows/operate/start-conversation">
    For Initiator flows — manually kick off an outbound conversation.
  </Card>

  <Card title="Conversations history" icon="clock-rotate-left" href="/conversation-flows/operate/conversations-history">
    Review what's been happening on deployed flows.
  </Card>
</CardGroup>
