Skip to main content

Content Creation Pipeline with Graph Structure

This example demonstrates how to build a complex content workflow using a directed graph - perfect for workflows that need both parallel processing and sequential dependencies.
Premium: Graph Workflow is available only on Pro, Ultra, and Premium plans. See Pricing.

Step 1: Get Your API Key

  1. Visit https://swarms.world/platform/api-keys
  2. Sign in or create an account
  3. Ensure you have a Pro or Ultra plan
  4. Generate a new API key
  5. Set it as an environment variable:

Step 2: Setup

Step 3: Define Your Graph Workflow

Create a content pipeline where research happens in parallel, then flows into writing, editing, and finally SEO:

Step 4: Run the Workflow

Expected Output:
Graph Workflow allows you to define complex dependencies:
  • Parallel execution: Multiple researchers work simultaneously
  • Sequential dependencies: Writer waits for all research, Editor waits for Writer
  • Clear flow: Entry points → Processing → End points
Use edges to define how data flows between agents.

Graph Structure Visualization


Software Code Review Pipeline

This example demonstrates a parallel code review pipeline where three specialized reviewers (code quality, security, performance) analyze code simultaneously, then a synthesizer produces a unified go/no-go recommendation. Graph structure:
Expected Output:
This pattern is ideal for automated CI/CD code review — all three reviewers run in parallel so the total latency is only as long as the slowest reviewer, not the sum of all three.

Multi-Language Content Localization (Multiple End Points)

This example demonstrates a fan-out workflow with multiple end points — a content strategist creates source content, which fans out to three translators running in parallel. Each translator is an independent end point. Graph structure:
Expected Output:
This pattern showcases multiple end points — unlike most examples where outputs converge, here the graph fans out and each translator is an independent terminal node. This is perfect for localization, A/B test generation, or multi-format content creation.

Financial Due Diligence Pipeline

This example demonstrates a multi-stage pipeline where parallel analysis feeds into sequential decision-making — two analysts work in parallel, their findings converge into a risk assessor, which then feeds an investment committee for a final recommendation. Graph structure:
Expected Output:
This pattern demonstrates a multi-stage DAG — parallel entry points feed a middle layer, which feeds the final decision node. Each stage builds on the outputs of the previous stage. The RiskAssessor has access to both the financial and market analyses before it runs, and the InvestmentCommittee sees everything.

When to Use Graph Workflow

  • Complex dependencies: Some agents depend on multiple others
  • Parallel + Sequential: Mix parallel and sequential processing
  • Multiple entry/exit points: Workflows with multiple starts or ends
  • DAG structures: Any directed acyclic graph workflow

Pattern Comparison