{
  "original_draft": {
    "agent_name": "sdr_agent",
    "goal": "Automate sales development outreach: score contacts by priority, filter suspicious profiles, generate personalized messages, and create Gmail drafts for human review.",
    "description": "",
    "success_criteria": [
      "Contacts are correctly scored and ranked by priority factors (alumni status, connection degree, domain verification)",
      "Suspicious profiles (risk_score >= 7) are correctly identified and excluded from outreach",
      "Generated messages reference specific profile details (alumni connection, role, company) and match the outreach goal",
      "Gmail drafts are created for all safe contacts without errors"
    ],
    "constraints": [
      "Agent creates Gmail drafts but NEVER sends emails automatically",
      "Must not process more contacts than the configured max_contacts parameter",
      "Contacts with risk_score >= 7 must be excluded from outreach"
    ],
    "nodes": [
      {
        "id": "intake",
        "name": "Intake",
        "description": "Receive the contact list and outreach goal from the user. Confirm the strategy and batch size before proceeding.",
        "node_type": "event_loop",
        "tools": [
          "load_contacts_from_file"
        ],
        "input_keys": [
          "contacts",
          "outreach_goal",
          "max_contacts",
          "user_background"
        ],
        "output_keys": [
          "contacts",
          "outreach_goal",
          "max_contacts",
          "user_background"
        ],
        "success_criteria": "The user has confirmed the contact list, outreach goal, batch size, and their background. All four keys have been written via set_output.",
        "sub_agents": [],
        "flowchart_type": "start",
        "flowchart_shape": "stadium",
        "flowchart_color": "#8aad3f"
      },
      {
        "id": "score-contacts",
        "name": "Score Contacts",
        "description": "Score and rank each contact from 0 to 100 based on priority factors: alumni status, connection degree, domain verification, mutual connections, and active job postings.",
        "node_type": "event_loop",
        "tools": [
          "load_data",
          "append_data"
        ],
        "input_keys": [
          "contacts",
          "outreach_goal"
        ],
        "output_keys": [
          "scored_contacts"
        ],
        "success_criteria": "Every contact has a priority_score field (0-100) and scored_contacts.jsonl has been written and referenced via set_output.",
        "sub_agents": [],
        "flowchart_type": "database",
        "flowchart_shape": "cylinder",
        "flowchart_color": "#508878"
      },
      {
        "id": "filter-contacts",
        "name": "Filter Contacts",
        "description": "Analyze each contact for authenticity and filter out suspicious profiles. Any contact with a risk score of 7 or higher is skipped.",
        "node_type": "event_loop",
        "tools": [
          "load_data",
          "append_data"
        ],
        "input_keys": [
          "scored_contacts"
        ],
        "output_keys": [
          "safe_contacts",
          "filtered_count"
        ],
        "success_criteria": "Each contact has a risk_score and recommendation field. Contacts with risk_score >= 7 are excluded. safe_contacts.jsonl and filtered_count are set via set_output.",
        "sub_agents": [],
        "flowchart_type": "database",
        "flowchart_shape": "cylinder",
        "flowchart_color": "#508878"
      },
      {
        "id": "personalize",
        "name": "Personalize",
        "description": "Generate a personalized outreach message for each contact based on their profile, shared background, and the user's outreach goal.",
        "node_type": "event_loop",
        "tools": [
          "load_data",
          "append_data"
        ],
        "input_keys": [
          "safe_contacts",
          "outreach_goal",
          "user_background"
        ],
        "output_keys": [
          "personalized_contacts"
        ],
        "success_criteria": "Every safe contact has an outreach_message field of 80-120 words that references a specific hook from their profile. personalized_contacts.jsonl is set via set_output.",
        "sub_agents": [],
        "flowchart_type": "database",
        "flowchart_shape": "cylinder",
        "flowchart_color": "#508878"
      },
      {
        "id": "send-outreach",
        "name": "Send Outreach",
        "description": "Create Gmail draft emails for each contact using their personalized message. Drafts are created for human review \u2014 emails are never sent automatically.",
        "node_type": "event_loop",
        "tools": [
          "gmail_create_draft",
          "load_data",
          "append_data"
        ],
        "input_keys": [
          "personalized_contacts",
          "outreach_goal"
        ],
        "output_keys": [
          "drafts_created"
        ],
        "success_criteria": "A Gmail draft has been created for every safe contact. drafts.jsonl records each draft and drafts_created is set via set_output.",
        "sub_agents": [],
        "flowchart_type": "database",
        "flowchart_shape": "cylinder",
        "flowchart_color": "#508878"
      },
      {
        "id": "report",
        "name": "Report",
        "description": "Generate a summary report of the outreach campaign: contacts scored, filtered, messaged, and drafts created. Present to user for review.",
        "node_type": "event_loop",
        "tools": [
          "load_data"
        ],
        "input_keys": [
          "drafts_created",
          "filtered_count",
          "outreach_goal"
        ],
        "output_keys": [
          "summary_report"
        ],
        "success_criteria": "A campaign summary has been presented to the user listing totals for contacts scored, filtered, messaged, and drafts created. summary_report is set via set_output.",
        "sub_agents": [],
        "flowchart_type": "terminal",
        "flowchart_shape": "stadium",
        "flowchart_color": "#b5453a"
      }
    ],
    "edges": [
      {
        "id": "edge-0",
        "source": "intake",
        "target": "score-contacts",
        "condition": "on_success",
        "description": "",
        "label": ""
      },
      {
        "id": "edge-1",
        "source": "score-contacts",
        "target": "filter-contacts",
        "condition": "on_success",
        "description": "",
        "label": ""
      },
      {
        "id": "edge-2",
        "source": "filter-contacts",
        "target": "personalize",
        "condition": "on_success",
        "description": "",
        "label": ""
      },
      {
        "id": "edge-3",
        "source": "personalize",
        "target": "send-outreach",
        "condition": "on_success",
        "description": "",
        "label": ""
      },
      {
        "id": "edge-4",
        "source": "send-outreach",
        "target": "report",
        "condition": "on_success",
        "description": "",
        "label": ""
      },
      {
        "id": "edge-5",
        "source": "report",
        "target": "intake",
        "condition": "on_success",
        "description": "",
        "label": ""
      }
    ],
    "entry_node": "intake",
    "terminal_nodes": [
      "report"
    ],
    "flowchart_legend": {
      "start": {
        "shape": "stadium",
        "color": "#8aad3f"
      },
      "terminal": {
        "shape": "stadium",
        "color": "#b5453a"
      },
      "process": {
        "shape": "rectangle",
        "color": "#b5a575"
      },
      "decision": {
        "shape": "diamond",
        "color": "#d89d26"
      },
      "io": {
        "shape": "parallelogram",
        "color": "#d06818"
      },
      "document": {
        "shape": "document",
        "color": "#c4b830"
      },
      "database": {
        "shape": "cylinder",
        "color": "#508878"
      },
      "subprocess": {
        "shape": "subroutine",
        "color": "#887a48"
      },
      "browser": {
        "shape": "hexagon",
        "color": "#cc8850"
      }
    }
  },
  "flowchart_map": {
    "intake": [
      "intake"
    ],
    "score-contacts": [
      "score-contacts"
    ],
    "filter-contacts": [
      "filter-contacts"
    ],
    "personalize": [
      "personalize"
    ],
    "send-outreach": [
      "send-outreach"
    ],
    "report": [
      "report"
    ]
  }
}