Skip to content

Agentic Workflows

Single prompts are good for tasks. Agentic workflows are required for processes.

The agent reviews its own work before showing it to you.

sequenceDiagram
    participant User
    participant Generator
    participant Critic
    
    User->>Generator: "Write a blog post about AI."
    Generator->>Critic: "Here is the draft."
    Critic->>Generator: "Too generic. Add more examples."
    Generator->>Critic: "Here is v2."
    Critic-->>User: "Final Draft."

The agent knows when it doesn’t know, and uses a tool to find out.

  • Trigger: “What is the stock price of Apple?”
  • Action: Agent pauses, calls get_stock_price('AAPL'), receives $150.
  • Response: “Apple is trading at $150.”

Breaking a goal into steps.

  • Goal: “Research competitor X and write a summary.”
  • Plan:
    1. Search Google for “Competitor X features”.
    2. Search Google for “Competitor X pricing”.
    3. Read top 3 results.
    4. Synthesize findings.
  • Trigger: New employee added to HR system.
  • Workflow:
    1. Agent A: Generates email account.
    2. Agent B: Invites to Slack channels based on department.
    3. Agent C: Schedules welcome meeting with manager.
    4. Agent D: Sends hardware request to IT.
  • Trigger: “Migrate this repository from Python 2 to 3.”
  • Workflow:
    1. Scanner Agent: Identifies all files needing change.
    2. Coder Agent: Rewrites file X.
    3. Tester Agent: Runs tests. If fail, send back to Coder Agent.
    4. Manager Agent: Tracks progress and opens PR when 90% tests pass.

For high-stakes workflows, the agent should pause for approval.

graph TD
    A[Agent Drafts Email] --> B{Risk Check}
    B -- Low Risk --> C[Send]
    B -- High Risk --> D[Human Approval]
    D -- Approve --> C
    D -- Reject --> A