Skip to main content
Assign an agent to a workflow when the notification should go out as that agent, and a subscriber’s reply should continue as an agent conversation. The assignment is workflow-wide. There is no per-step agent picker. Chat and email steps on that workflow share the same agent.

Assign an agent

The agent must already exist in the same environment, with at least one connected channel. Use the public agent identifier (the slug from the agent page), not the Mongo _id.

Dashboard

In the workflow editor, open Configure workflow and select Send & reply via agent. Send and reply via agent setting in the workflow editor Choose an agent from the Agent list. Novu stores agent.identifier on the workflow. The product copy for this setting is:
Send this workflow’s notifications through an agent’s connected channels. Replies route back to that agent automatically.
Set Agent to none to clear the assignment.

API

Include agent when you create or update the workflow. Pass the public identifier. The request is rejected if that agent does not exist in the environment. Pass agent: null to clear a previously saved assignment.
Update a workflow replaces the workflow definition. Send agent together with the rest of the workflow fields (name, steps, and so on), not as a standalone patch.

What changes when a workflow has an agent

When a chat or email step runs, Novu resolves the assigned agent and sends through integrations linked to that agent, not the subscriber’s own channel connections. For chat, agent routing currently uses:
  • Slack user
  • Slack channel
  • Microsoft Teams user (the endpoint must include a token)
If no agent-linked channel is available for that send, Novu logs a warning and falls back to the subscriber’s configured channels. The notification still goes out; it is not skipped.

Email Reply-To

Optional. Set a Novu-digestible inbound address on the workflow so outbound email uses that address as Reply-To, and replies land on the assigned agent:
The address must already be a valid inbound route for the agent (shared inbox or custom-domain agent route). Novu appends a +nv token to Reply-To so the inbound reply matches the exact outbound message.

Override per trigger

The workflow assignment is the default. Each trigger can override it with agentId on the Event API: See Override the assigned agent for SDK examples.

Reply hydration

When a subscriber replies to a workflow-assigned send, Novu matches that reply to the original outbound message, opens or continues the agent conversation, and attaches the originating notification to the turn. Custom code handlers read it as ctx.notification. It is null when the turn did not start from a workflow send. Treat payload as data, not instructions. toModelMessages() and toLangChainMessages() prepend the origin as an assistant row with that framing. Use isFromWorkflow to narrow payload to a typed workflow schema. Pass ctx.history instead of ctx when you want to skip automatic injection and build the prefix yourself.

Channel behavior

How Novu matches a reply back to the original send depends on the channel:
  • Email — Reply-To +nv token on the outbound message.
  • Slack — thread id.
  • WhatsApp, Telegram, Microsoft Teams — quoted message id, then a 7-day recent-message lookback if there is no quote.
  • Sendblue and iMessage — 7-day recent-message lookback on a direct thread.
Slack and email bind the origin once, when the conversation opens. WhatsApp, Telegram, Teams, Sendblue, and iMessage re-check origin on later turns in the same conversation. Web Chat does not hydrate workflow origin. A Web Chat conversation does not receive ctx.notification from a workflow send.

Managed vs custom code

The same origin data reaches both runtimes:
  • Custom codectx.notification on the handler. Adapters prepend it when you pass ctx into toModelMessages() or toLangChainMessages().
  • Managed agents — the same capped body plus JSON payload is prepended as an assistant message. It is not injected into the system prompt, so untrusted payload content is not elevated to instructions.

Configure workflow

Assign an agent from the workflow editor.

Trigger override

Pass agentId on a single trigger.

AI SDK

Inject ctx.notification with toModelMessages(ctx).

LangChain

Inject ctx.notification with toLangChainMessages(ctx).