How-To Guides8 min read

How to Set Up Multi-Agent Chains in Pluggin.ai

A step-by-step guide to setting up multi-agent chains in Pluggin.ai, including the three pre-built chain types, conditional logic, and best practices for orchestrating autonomous workflows.

Pluggin.ai Team·

Multi-agent chains are sequences of AI agents that execute in a defined order, where the output of one agent becomes the input for the next, enabling complex business workflows to run autonomously with minimal human intervention. In Pluggin.ai, chains are the backbone of multi-agent workflows and allow teams to orchestrate everything from lead qualification to financial reconciliation without writing a single line of code.

This guide walks you through setting up your first chain, configuring conditions between steps, and leveraging the three pre-built chain templates that ship with every Pluggin.ai workspace.

Why Multi-Agent Chains Matter

Single-agent setups handle straightforward tasks well. But real business operations rarely involve just one step. Consider a typical sales workflow: a lead comes in from HubSpot, needs to be enriched with data from Apollo, scored against your ICP, and then routed to the right sales rep via Slack. That is four distinct tasks, each requiring different tools, data sources, and decision logic.

Chains solve this by letting you link agents together. Each agent in the chain has its own system prompt, connected integrations, and success criteria. When one agent finishes, the chain evaluates a condition and decides whether to proceed, branch, or halt.

The Three Pre-Built Chain Templates

Pluggin.ai ships with three chain templates designed for the most common business patterns. These are not demo toys. They are production-ready starting points.

1. Sequential Processing Chain

The Sequential Processing Chain runs agents one after another in a strict linear order. Agent A completes, passes its output to Agent B, which passes to Agent C, and so on.

Best for: Data enrichment pipelines, content publishing workflows, invoice processing sequences.

How to use it:

  • Navigate to the Chains tab in your Pluggin.ai dashboard.
  • Select "Sequential Processing" from the template library.
  • Add your agents in the order you want them to execute.
  • Define the data fields that pass between each step.

2. Conditional Branching Chain

The Conditional Branching Chain introduces decision points between agents. After an agent completes, a condition evaluates its output and routes the workflow down one of multiple paths.

Best for: Lead routing based on score thresholds, support ticket triage, approval workflows with different escalation paths.

How to use it:

  • Select "Conditional Branching" from the template library.
  • Add your first agent.
  • At the branch point, define your conditions using Pluggin.ai's condition builder (e.g., "if lead_score > 80, route to Agent B; otherwise, route to Agent C").
  • Build out each branch with its own sequence of agents.

3. Parallel Execution Chain

The Parallel Execution Chain runs multiple agents simultaneously, then merges their outputs at a convergence point. This is useful when you need to gather data from multiple sources before making a decision.

Best for: Competitive analysis (scrape multiple sources at once), multi-channel outreach (email + Slack + SMS simultaneously), data aggregation from multiple APIs.

How to use it:

  • Select "Parallel Execution" from the template library.
  • Define your starting agent.
  • Add parallel branches, each with its own agent or agent sequence.
  • Configure the merge point and define how outputs are combined.

Step-by-Step: Building Your First Chain

Here is a concrete walkthrough for building a lead qualification chain that connects Apollo, HubSpot, and Slack.

Step 1: Create a New Chain

Open the Pluggin.ai dashboard and navigate to "Chains" in the left sidebar. Click "New Chain" and give it a descriptive name, such as "Inbound Lead Qualification Pipeline."

Step 2: Add the Trigger

Every chain starts with a trigger. Select "HubSpot: New Contact Created" as your trigger event. This fires the chain whenever a new lead enters your CRM.

Step 3: Add the Enrichment Agent

Add your first agent to the chain. This agent should be configured with the Apollo connector to enrich the lead's profile with company data, job title, funding stage, and employee count. Set the system prompt to instruct the agent on which fields to extract and how to structure the output.

Step 4: Add the Scoring Agent

Connect a second agent that takes the enriched data and scores the lead against your Ideal Customer Profile. This agent uses reasoning to weigh multiple factors, not just a simple point system. Configure it with your ICP criteria in the system prompt.

Step 5: Configure the Condition

Between the scoring agent and the next step, add a condition. This is where chains differ from simple automations. The condition evaluates the agent's natural language output, not just a numeric field. For example: "If the agent classified the lead as 'high priority,' proceed to the fast-track sequence."

Step 6: Add the Routing Agents

On the high-priority branch, add an agent that posts to Slack with the lead summary and assigns the lead in HubSpot to a senior rep. On the standard branch, add an agent that enrolls the lead in a nurture sequence via Gmail.

Step 7: Test and Deploy

Use the chain preview to run a test with sample data. Verify that each agent produces the expected output and that conditions route correctly. Once validated, set the chain to active.

How Conditions Work

Conditions in Pluggin.ai are more sophisticated than traditional if-then rules. They can evaluate:

  • Structured data fields: Numeric comparisons, string matching, boolean checks.
  • Agent output classification: The condition can interpret the agent's natural language response and classify it into categories you define.
  • External state: Conditions can check data from connected integrations (e.g., "Does this contact already exist in HubSpot?").
  • Time-based rules: Execute different branches depending on the day of the week or time of day.

This flexibility means your chains can handle nuanced business logic that would be impossible to express in a traditional automation platform like Zapier or Make.

Best Practices for Chain Design

Keep agents focused. Each agent in a chain should do one thing well. Resist the temptation to create a single mega-agent that handles everything.

Use descriptive naming. Name your agents and chains clearly. "Lead Enrichment - Apollo" is better than "Agent 2."

Add approval gates at critical junctures. For any step that involves sending external communications or modifying financial records, insert an approval gate to keep a human in the loop. Learn more about this in our approval gates guide.

Monitor chain performance. Pluggin.ai provides execution logs for every chain run. Review these weekly to identify bottlenecks or agents that frequently fail.

Start with a pre-built template. Modify a template rather than building from scratch. The templates encode best practices that are easy to overlook when starting from a blank canvas.

When to Use Chains vs. Single Agents

Not every task needs a chain. Use a single agent for straightforward, one-step tasks like drafting an email or summarizing a document. Use chains when your workflow involves multiple steps, requires data from multiple integrations, or includes decision points that affect downstream actions.

For a deeper dive into multi-agent patterns and real-world use cases, visit our multi-agent workflows page.

Frequently Asked Questions

How many agents can I include in a single chain?

Pluggin.ai does not impose a hard limit on the number of agents in a chain. In practice, most production chains use between three and eight agents. Chains with more than ten agents should be reviewed for opportunities to consolidate or split into sub-chains.

Can I reuse the same agent across multiple chains?

Yes. Agents in Pluggin.ai are independent entities. You can include the same agent in as many chains as needed. Changes to the agent's configuration will apply across all chains that reference it.

Do chains run in real time or on a schedule?

Both. Chains can be triggered by real-time events (e.g., a new HubSpot contact, an incoming Slack message) or scheduled to run at fixed intervals (e.g., every morning at 9 AM). The trigger type is configured when you create the chain.

What happens if an agent in the middle of a chain fails?

Pluggin.ai pauses the chain at the point of failure and sends a notification to your configured alert channel (Slack, email, or in-app). You can review the error, fix the issue, and either retry from the failed step or restart the entire chain.

Can I add approval gates between chain steps?

Absolutely. Approval gates can be inserted at any point in a chain. When the chain reaches an approval gate, it pauses and waits for a human to approve or reject before continuing. This is especially important for chains that interact with customers or process financial transactions. See our multi-agent workflows overview for implementation patterns.

chainstutorialmulti-agentsetuphow-to

Ready to automate your business?

20 free credits. 10 agents ready to deploy. No credit card required.