Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/vrashmanyu605-eng/Agentic_Sales-Markerting/llms.txt

Use this file to discover all available pages before exploring further.

Every agent in the pipeline communicates exclusively through SalesMarketingState. No agent calls another directly; each reads the fields it needs, does its work, and returns a dict of updated fields that LangGraph merges back into the shared state. This means you can add, remove, or reorder agents without changing how data flows — as long as the fields they depend on are populated by an earlier step.
SalesMarketingState is declared with total=False, making every field optional by default. Agents only read what they need and only write what they produce. A field that has not yet been set by any agent will be absent from the dict (not None) unless explicitly initialized in initial_state.

Full source

graph/state.py
from typing_extensions import TypedDict
from typing import Optional, List


class SalesMarketingState(TypedDict, total=False):

    # =====================================================
    # TASK INPUT
    # =====================================================

    task: str

    company_name: str

    target_industry: str

    sender_name: str

    # =====================================================
    # RAW INPUTS
    # =====================================================

    sales_deck_text: str

    client_requirements: str

    competitors_data: str

    # =====================================================
    # BUSINESS DATA
    # =====================================================

    company_services: str

    service_details: str

    ideal_customer_profile: str

    pricing_information: str

    # =====================================================
    # AGENT OUTPUTS
    # =====================================================

    lead_research: str

    pending_leads: list

    icp_analysis: str

    competitor_analysis: str

    outreach_content: str

    proposal_document: str

    sales_strategy: str

    marketing_content: str

    client_sentiment: str

    crm_update: str

    enriched_leads: list

    # =====================================================
    # INPUT DATA FOR SPECIFIC AGENTS
    # =====================================================

    meeting_transcript: str

    meeting_transcripts: List[str]

    client_name: str

    email_threads: List[str]

    case_studies: str

    pricing_data: str

    spreadsheet_id: str

    spreadsheet_range: str

    discovered_leads: List[dict]

    current_lead_index: int

    active_lead: dict

    # =====================================================
    # WORKFLOW CONTROL
    # =====================================================

    workflow_stage: str

    next_agent: str

    workflow_history: List[str]

    completed_agents: List[str]

    failed_agents: List[str]

    # =====================================================
    # EXECUTION STATUS
    # =====================================================

    completed: bool

    progress_percentage: int

    supervisor_reasoning: str

    error: Optional[str]

Field reference

Task input

These fields define the top-level goal for the workflow run. You set them in initial_state before calling app.stream().
task
str
Natural language description of what the workflow should accomplish. Read by the discovery agent to guide its search strategy.Example: "Find potential IT services leads, research them, generate outreach strategies and proposals, and save all details to Google Sheets."
company_name
str
Name of the company currently being processed. The supervisor sets this by reading current_lead["company_name"] when it pops a lead from pending_leads. Cleared to None when the workflow ends.
target_industry
str
Industry vertical to target during lead discovery. Passed to the discovery agent to filter search results.Example: "IT Services / AI Automation"
sender_name
str
Name of the person sending outreach on behalf of the company. Used by the outreach generation agent to personalize emails and messages.

Raw inputs

These fields hold documents and data you provide at startup. Agents use them as context for analysis and content generation.
sales_deck_text
str
Full text extracted from your sales deck PDF. Loaded by main.py using extract_pdf_text() before the workflow starts. Agents use this to understand your service offerings when generating proposals and outreach.
client_requirements
str
Requirements document or job description read from jd.txt. Used by the discovery agent to match leads and by content agents to tailor messaging.
competitors_data
str
Seed data about known competitors. The competitor analysis agent builds on this with live research for each lead.

Business data

Fields describing your company’s services, positioning, and pricing. Set these in initial_state to give agents the context they need to produce accurate, personalized content.
company_services
str
Comma-separated list of services your company provides. Used in proposals and outreach to match offerings to each lead’s needs.
service_details
str
Longer description of your service capabilities. Gives agents richer context for proposal generation.
ideal_customer_profile
str
Description of your target customer. The ICP matching agent compares each lead against this field to produce a fit score.
pricing_information
str
High-level pricing range or structure. Included in proposals and outreach when relevant.Example: "Projects range $10k-$50k."

Agent outputs

These fields are written by agents as they complete their work. Each field is cleared by the supervisor before processing the next lead, so agents always see fresh data for the active lead.
lead_research
str
Research findings for the active lead, written by lead_research_agent. Includes website content summary, key personnel, and company background.
pending_leads
list
Queue of lead objects waiting to be processed. Populated by discovery_agent. The supervisor pops one lead at a time by reading pending_leads[0] and writing pending_leads[1:] back to state.
icp_analysis
str
ICP fit assessment for the active lead, written by icp_matching_agent. Includes a fit score and rationale based on ideal_customer_profile.
competitor_analysis
str
Competitive landscape analysis for the active lead’s deal, written by competitor_analysis_agent.
outreach_content
str
Personalized outreach materials written by outreach_generation_agent. Typically includes an email, LinkedIn message, follow-up sequence, and call pitch.
proposal_document
str
Structured IT services proposal written by proposal_generation_agent. Incorporates lead research, ICP fit, and your service details.
sales_strategy
str
Deal-specific sales strategy, written by sales_strategy_agent. This agent is registered but not connected by pipeline edges in the default workflow.
marketing_content
str
Marketing collateral for the lead, written by marketing_content_agent. This agent is registered but not connected by pipeline edges in the default workflow.
client_sentiment
str
Sentiment analysis output from client_sentiment_agent. This agent is registered but not connected by pipeline edges in the default workflow.
crm_update
str
Confirmation or summary of the Google Sheets write operation, written by crm_update_agent. Indicates what was saved and where.
enriched_leads
list
List of enriched contact objects for the current lead, produced by lead_research_agent. Each entry contains the contact’s name, LinkedIn URL, and a list of possible email addresses. Overwritten for each new lead.

Agent-specific inputs

These fields provide context that specific agents need. Set them in initial_state or let upstream agents populate them.
meeting_transcript
str
Single meeting transcript. Used by crm_update_agent to extract CRM data such as client requirements, objections, and next steps.
meeting_transcripts
List[str]
List of meeting transcripts. Used by client_sentiment_agent to analyze sentiment trends across multiple interactions.
client_name
str
Name of an existing client or prospect. Distinct from company_name — used by content agents when addressing the recipient directly.
email_threads
List[str]
Existing email threads with a prospect. Used by client_sentiment_agent to analyze sentiment and buying signals from prior communications.
case_studies
str
Summaries of past successful projects. Included in proposals and outreach to build credibility.
pricing_data
str
Detailed or custom pricing information. More granular than pricing_information; used when a proposal requires scope-specific pricing.
spreadsheet_id
str
Google Sheets spreadsheet ID. The crm_update_agent uses this to identify which sheet to write to.Example: "1MsG4jkVacHwuw2cxTQ_Vt5cW5qKoBgGJH1IqfDCdRto"
spreadsheet_range
str
A1 notation range for CRM writes.Example: "Sheet1!A1"
discovered_leads
List[dict]
Declared in the schema for extensibility. In the default pipeline, discovery_agent writes leads directly to pending_leads. This field is available for custom agents or pipelines that want to separate raw discovery results from the supervisor’s processing queue.
current_lead_index
int
Numeric index tracking position in the lead list. Initialized to 0 in initial_state.
active_lead
dict
The full lead object currently being processed. Declared in the schema; the supervisor writes current_lead in practice — active_lead is available for custom agents that prefer this key name.

Workflow control

These fields coordinate execution flow. The supervisor reads and writes most of them; the router reads next_agent to decide where to go next.
workflow_stage
str
Human-readable label for the current phase of the workflow. Initialized to "start" and updated as the workflow progresses.
next_agent
str
The routing signal written by the supervisor and read by supervisor_router. Valid values in the default pipeline are "lead_research_agent" (process next lead) and "finished" (terminate).
workflow_history
List[str]
Append-only log of agents that have executed. Printed as a summary at the end of a successful workflow run.
completed_agents
List[str]
List of agent names that have completed successfully in the current run.
failed_agents
List[str]
List of agent names that raised an error. Used for diagnostics and potential retry logic.

Execution status

Top-level status fields for monitoring and error reporting.
completed
bool
True when the workflow has finished processing all leads. Initialized to False.
progress_percentage
int
Integer from 0 to 100 representing workflow progress. Initialized to 0.
supervisor_reasoning
str
Free-text explanation of the supervisor’s last routing decision. Declared in the schema for observability; main.py reads and prints this field if populated. The current deterministic supervisor does not write to it, but you can add reasoning strings here when extending the supervisor.
error
Optional[str]
Error message if the workflow encountered an unhandled exception. None during normal execution.

Learn more

Workflow graph

How nodes, edges, and the supervisor router connect in the StateGraph

Architecture overview

Three-layer design and how agents, tools, and state fit together

Build docs developers (and LLMs) love