Skip to main content
A workflow that runs multiple research tracks in parallel, then combines results using a reusable summarizer component.

parallel-research.toon

name: parallel-research
agents:
  researcher:
    type: claude-code
    model: claude-opus-4-6
    subscription: true
    instructions: You are an expert research assistant.
  writer:
    type: claude-code
    model: claude-opus-4-6
    subscription: true
    instructions: You are a concise technical writer.

input:
  topic: string
  sources: "string[]"

components:
  Summarizer:
    params:
      content: string
      maxWords: number
      style: "bullet" | "prose"
    steps[1]:
      - id: "{id}-summarize"
        agent: writer
        prompt: "Summarize the following content in at most {params.maxWords} words.\nStyle: {params.style}\n\nContent:\n{params.content}"
        output:
          summary: string
          wordCount: number

steps[3]:
  - kind: parallel
    children[3]:
      - id: research-web
        agent: researcher
        prompt: "Search the web for recent information about: {input.topic}\nFocus on authoritative sources and recent developments."
        output:
          findings: string
          sources: "string[]"

      - id: research-academic
        agent: researcher
        prompt: "Search academic papers and technical publications about: {input.topic}\nFocus on peer-reviewed sources and foundational work."
        output:
          findings: string
          papers: "string[]"

      - id: research-community
        agent: researcher
        prompt: "Search developer communities (forums, blogs, discussions) about: {input.topic}\nFocus on practical experience and common pitfalls."
        output:
          findings: string
          discussions: "string[]"

  - kind: parallel
    children[3]:
      - id: web-summary
        kind: component
        use: Summarizer
        with:
          content: "{research-web.findings}"
          maxWords: 200
          style: "bullet"

      - id: academic-summary
        kind: component
        use: Summarizer
        with:
          content: "{research-academic.findings}"
          maxWords: 200
          style: "bullet"

      - id: community-summary
        kind: component
        use: Summarizer
        with:
          content: "{research-community.findings}"
          maxWords: 200
          style: "bullet"

  - id: final-report
    agent: writer
    prompt: "Synthesize these research summaries into a comprehensive report.\n\nWeb Research:\n{web-summary-summarize.summary}\n\nAcademic Research:\n{academic-summary-summarize.summary}\n\nCommunity Insights:\n{community-summary-summarize.summary}\n\nWrite a cohesive report that covers all perspectives."
    output:
      title: string
      report: string
      keyTakeaways: "string[]"
      totalSources: number

Run It

smithers run parallel-research.toon --input '{"topic": "Effect-TS for production services", "sources": ["web", "academic", "community"]}'

Key Patterns

  • kind: parallel runs the three research tracks concurrently
  • Component reuse: Summarizer is defined once and used three times with different parameters
  • ID interpolation: {id}-summarize generates web-summary-summarize, academic-summary-summarize, etc.
  • Two parallel phases: first the research runs in parallel, then the summaries run in parallel
  • Final synthesis: the final-report step waits for all parallel branches to complete before running

Execution Timeline

            ┌─ research-web ──────────┐
            │                         │
start ──────┼─ research-academic ─────┼──┐
            │                         │  │
            └─ research-community ────┘  │

            ┌─ web-summary ───────────┐  │
            │                         │  │
            ├─ academic-summary ──────┤  │
            │                         │  │
            └─ community-summary ─────┘  │

                                    final-report
All three research steps run concurrently. When all complete, all three summary components run concurrently. When those complete, the final report step runs.