Skip to main content

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.

This guide walks through the same flow used as the running example throughout these docs: a Sales Triage flow with three AI agents. By the end you’ll have a deployed flow you can talk to, a test session that demonstrates routing, and a clear mental model for building your own multi-agent flows. Estimated time: 20 minutes.

What we’re building

A user opens the chat widget on acme.com, asks a question, gets routed to the right specialist, gets an answer that uses the company’s own context.

Step 1 — Create the flow

1

Open Conversations

From the workspace sidebar, click ConversationsNew Flow. A blank flow opens.
2

Rename

Double-click “Untitled Flow” at the top and rename to Sales Triage.

Step 2 — Set the global context

Every actor will inherit this. We write it once.
1

Open Flow settings

Click the gear icon in the bottom-right toolbar.
2

Paste the global context

In the Global Context field:
You work for Acme Inc., a SaaS platform that sells two products:

- Acme Pro — a self-serve workflow builder, $49/seat/month, 14-day free trial.
- Acme Enterprise — adds SSO, SLAs, a dedicated success manager, and audit
  logs. Custom pricing, annual contract.

Always be friendly, concise, and professional.
3

Save and close

Click Save Changes, then close the panel.

Step 3 — Create the Triage agent

1

Click Add Actor

In the bottom toolbar. Name it Triage and click Create.Triage appears on the canvas, connected from Start.
2

Click Triage to open its config

The right-side panel opens.
3

Fill in three fields

FieldValue
ContextLeave blank. It inherits global context.
InstructionsGreet the user and ask one short qualifying question to figure out whether they want to talk about product features or pricing. As soon as you know which one, hand off — don't try to answer specifics yourself.
Definition of DoneThe user's intent is clear (product vs pricing) and the conversation has been handed off to the right specialist.
4

Save

Click Save Changes.

Step 4 — Create the two specialists

Repeat the Add Actor flow twice.
FieldValue
NameProduct Specialist
ContextYou are the product expert for Acme Inc. You know everything about Acme Pro and Acme Enterprise — features, integrations, security, supported channels, roadmap.
InstructionsAnswer product questions in clear, plain language. If the user asks about pricing or plans, hand off — don't quote prices.
After both are saved, you have four nodes on the canvas. Both specialists are auto-wired from Start — we’ll fix that next.

Step 5 — Wire routing edges

We want Start → Triage, then Triage → Product and Triage → Pricing.
1

Delete the auto-wired edges from Start to specialists

Click the line connecting Start to Product Specialist. Press Delete. Repeat for Start → Pricing Specialist.Only Start → Triage remains.
2

Draw Triage → Product Specialist

Hover the bottom of the Triage node. Drag the handle that appears onto the Product Specialist node. An edge appears.
3

Click the new edge and add an activation prompt

When the user asks about product features, integrations, capabilities, security, the roadmap, or how something works in the product.
Click Save. A short label appears on the edge (“Product”), auto-generated by AI from the prompt.
4

Repeat for Pricing Specialist

Draw Triage → Pricing Specialist, click the edge, paste:
When the user asks about price, plans, seats, discounts, free trial, or wants a quote for an Enterprise contract.
Save. The “Pricing” label appears.
Your canvas now matches the diagram at the top of this guide.
Sales Triage flow on canvas

Step 6 — Configure the widget channel

1

Open Flow settings → Channels

Click the gear icon, then the Channels tab.
2

Add a Widget channel

Click Add ChannelWidget.
FieldValue
NameAcme website widget
GreetingHi! I’m the Acme assistant — happy to help with product or pricing questions.
ThemeLight
3

Save

The widget appears in the channel list.

Step 7 — Test it

1

Click Test in the toolbar

A drawer opens on the right with a chat input.
2

Send a pricing question

how much does Acme Pro cost?
Wait a few seconds. The Pricing Specialist replies with the price ($49/seat, 14-day trial) and offers volume discounts. Below the reply, the debug panel shows:
[global] routeToActor → Triage — single top-level actor
[branch] routeToChild → Pricing Specialist —
    User explicitly asks about the cost of Acme Pro,
    which is a pricing question. Route to Pricing Specialist.
actor done() → The assistant provided a clear answer.
Routing worked.
3

Send a follow-up question that switches topic

actually, does it support SSO?
Notice the routing trace this time. The flow’s global router decides this is a cross-cutting product-capability question and replies directly using global context — a cleaner answer than handing off to Product Specialist for a one-line yes/no.
Multi-turn test session
This is the routing layer adapting to the question. You don’t write any of it — the activation prompts plus global context give the platform enough signal.

Step 8 — Deploy

1

Close the test drawer

Click X. The test session is saved in Conversations history with a TEST badge.
2

Click Deploy

The status badge in the header changes from draft to active.
3

Embed the widget

Copy the embed snippet shown for the widget channel and paste it into your site’s HTML before </body>:
<script src="https://embed.cogniagent.ai/widget.js"
        data-flow-id="YOUR_FLOW_ID"
        async></script>
The widget appears as a chat bubble. Real visitors can now talk to your flow.

What you’ve built

  • A flow with global context (Acme product blurb) inherited by every actor.
  • Three actors, each with focused instructions and clear handoff rules.
  • Two routing edges with activation prompts that drive the handoff decisions.
  • A widget channel for inbound traffic on acme.com.
  • A deployed flow that’s live and answering real questions.

Extending the flow

Things you could add next:

Knowledge base

Connect a product documentation KB to Product Specialist so it can cite specific feature docs.

Calendar integration

Give Pricing Specialist a calendar integration so it can book an Enterprise quote call directly.

A Human Handoff actor

Add an actor that posts to your sales team’s Slack channel for hard cases.

Email channel

Add a Gmail channel so users can also reach the flow via email.

Lessons from this build

Both specialists and Triage share the Acme blurb. By putting it in Flow settings → Global Context, we wrote it once. Edits propagate immediately.
No intent = pricing syntax. Just describe when the route should fire as if explaining to a teammate. The platform handles the matching.
Triage’s DoD is “user’s intent is clear and handed off”. That tells the routing layer Triage is done as soon as it can identify the topic — keeping conversations from stalling.
Every routing decision is visible inline. When something misbehaves, the trace shows you where.

Next

Capabilities

Give your actors knowledge bases and integration actions.

Channels overview

Add more channels — email, Slack, phone, and more.