Skip to content
Novu logoNovu

Agent-Assigned Workflows

Turn a workflow notification into the first turn of an agent conversation, with the original message and trigger payload already in context.

Cover image for Agent-Assigned Workflows
Contributors
  • Nikita Grossman

    Nikita Grossman

  • Victor Yakubu

    Victor Yakubu

You can now assign an agent to a workflow from the Novu Dashboard. Workflow messages are sent through the agent's connected channels, and when a subscriber replies, Novu routes the reply to that agent with the originating workflow, message, and trigger payload already in context.

This closes the gap between notifications and conversations. A workflow can send “Your order has shipped,” the subscriber can reply “Can I change the delivery address?”, and the agent receives the order data from the original trigger without a separate correlation layer in your application.

Turn a notification into a conversation

Enable Send & reply via agent in the workflow editor and select the agent that should handle replies. Novu associates the outgoing workflow message with that agent and delivers it through the agent's applicable channel connection.

When the subscriber replies, Novu maps the response back to the sent notification. Depending on the channel, this uses the email reply token, the Slack thread, a quoted message on WhatsApp, Telegram, or Microsoft Teams, or the existing one-to-one conversation history on iMessage.

The original workflow context is attached when the conversation starts. Later replies reuse that context, so your application does not need to reload and attach the same notification data on every turn.

For example, an order-support workflow could provide the agent with the rendered shipping message and a payload containing the order ID, tracking number, and delivery address. The agent can then use those values when it handles a follow-up question.

Send through the agent's connected channels

An assigned workflow can send through agent-linked Slack, Microsoft Teams DM, WhatsApp, Telegram, iMessage through Sendblue, and email integrations when the subscriber is reachable on that connection.

Email can use an agent-specific sender and optional reply-to address, so replies return to the agent instead of a no-reply inbox.

If the selected agent does not have an applicable channel connection, Novu falls back to the provider integration configured in the environment and adds a warning to the step. The assignment does not silently drop the delivery. A Chat step is skipped only when the subscriber has no reachable Chat channel, which matches the existing delivery behavior.

Give custom code and managed agents the workflow context

Custom code agents receive a typed ctx.notification field when a conversation starts from an assigned workflow:

import { isFromWorkflow } from '@novu/framework';
import { orderShipped } from './workflows/order-shipped';

if (isFromWorkflow(ctx.notification, orderShipped)) {
  const { orderId, trackingNumber } = ctx.notification.payload;
}

When the workflow defines a payload schema, ctx.notification.payload uses that schema for type inference. The field is null when the conversation started with an inbound message instead of a workflow notification.

Managed agents receive the same originating workflow and payload data automatically as conversation context. Novu adds a short assistant message that identifies the workflow, followed by the payload as JSON. There is no handler to update.

The Agent Conversations timeline in the Dashboard also shows the originating workflow notification, so you can trace how the conversation started alongside the replies that followed.

Override the assigned agent for one trigger

The workflow assignment is the default. You can route a single execution to another agent by passing its public identifier as agentId:

await novu.trigger({
  workflowId: 'order-shipped',
  to: 'subscriber-123',
  payload: {
    orderId: 'order-456',
    trackingNumber: '1Z999AA10123456784',
  },
  agentId: 'order-support-agent',
});

Omit agentId to use the agent assigned in the workflow. Pass agentId: null when that execution should send without agent reply routing.

Open a workflow in the Dashboard and enable Send & reply via agent to get started. See the AI SDK quickstart, Trigger event API, and Agent Conversations documentation for the related APIs and runtime behavior.