# n8n + Jodoo Lead Qualification Recipe

## Workflow shape

1. Webhook node: receives the lead payload.
2. Agent Decision node: returns machine-readable qualification fields.
3. HTTP Request node: sends mapped fields to Jodoo.
4. Jodoo record: stores score, tier, owner, next action, and original output.

## Demo decision logic

The verified demo uses a credential-free Agent Decision code node. It returns deterministic fields for a synthetic lead so the workflow can be tested without adding external model credentials.

```json
{
  "ai_score": 88,
  "lead_tier": "Hot",
  "fit_reason": "The company has a clear operations use case, urgency, and a concrete demo request.",
  "missing_info": "Budget owner and launch timeline",
  "suggested_owner": "Sales Ops queue",
  "next_best_action": "Book a discovery call",
  "follow_up_draft": "Hi Sophia, thanks for sharing the operations rollout context. I can show how Jodoo keeps AI-scored leads and follow-up in one tracked workflow.",
  "routing_priority": "High"
}
```

## Production AI Agent prompt

You are a lead qualification agent for a B2B sales team. Review each inbound lead and return structured fields that Jodoo can store, route, and report on.

Score the lead from 0 to 100 using these signals:

- Fit: Does the company and request match the offer?
- Intent: Is the lead asking for evaluation, purchase, or implementation help?
- Urgency: Is there a clear timing signal?
- Company relevance: Is the company type, size, region, or workflow relevant?
- Missing information: What details should sales collect before follow-up?

Return only structured output. Do not return a loose paragraph.

## HTTP Request mapping

| n8n output | Jodoo field |
| --- | --- |
| record_title | Record title |
| lead_source | Lead source |
| contact_name | Contact name |
| company | Company |
| email | Email |
| campaign | Campaign |
| message | Message or request |
| ai_score | AI score |
| lead_tier | Lead tier |
| fit_reason | Fit reason |
| missing_info | Missing information |
| suggested_owner | Suggested owner |
| next_best_action | Next best action |
| follow_up_draft | Follow-up draft |
| routing_priority | Routing priority |
| full JSON response | Original agent output |

## Verified sample

- Test lead: Sophia Reed, Meridian Field Systems
- Source: n8n workflow test
- Outcome: Hot lead, high routing priority
- Jodoo data ID: 6a2005199be799f7b658db80

## Production notes

n8n Cloud or self-hosted n8n can run the orchestration. Model usage, hosting, credentials, and production execution volume can create costs. Keep Jodoo credentials out of public workflow files and test with synthetic leads before sending real customer data.
