← All ivy-agents
IVYXSTUDIO · IVY AGENT
L

Lead Qualifier

ivy.agent.lead-qualifier · v1.0.0

ivyx

Takes a website form submission, reads the company's site, has Jev say whether it is a business customer, and creates a CRM contact and a Slack line when it is; otherwise marks the lead low priority through your API.

Steps

In the order the agent's file lists them, each with where its inputs come from and the values the file fixes. A branch or a loop is a step too.

  1. 01
    Read the company's site
    ivy.node.web-page-text

    Fetches a web page and returns its readable text and title, without scripts, styles or markup.

    takes
    url from the agent's input, payload.company_website
    returns
    site_title
    Ivy Node
  2. 02
    Is it a business customer?
    ivy.node.jev-noul

    Asks TypeSafe Jev a yes-or-no question about a text or JSON state and returns noul, the probability that the answer is yes, with answer true when it reaches the threshold.

    takes
    state from step 1, text
    set
    instructions Judge from this website text whether the company sells software or online services to other businesses.
    criteria {"true":"A company that sells software, data or online services to other businesses.","false":"A consumer business, a...
    threshold 0.5
    secret
    jev_api_key the stored secret jev-api-key
    returns
    qualified
    Ivy Node
  3. 03
    Write the Slack line
    ivy.node.template-render

    Fills {{ name }} placeholders in a text template from a mapping, and reports which names were missing.

    takes
    values from the agent's input, payload
    set
    template Qualified lead: {{ name }} at {{ company }} ({{ email }})
    on_missing empty
    Ivy Node
  4. 04
    Only a qualified lead

    Lets what follows run only when answer of step 2 is true.

    Branch
  5. 05
    Create the CRM contact
    ivy.node.http-request

    Sends one HTTP request to a URL and returns the status, headers and body, parsed as JSON when the response is JSON.

    Runs only on the then branch of step 4.

    takes
    url from the agent's input, crm_url
    json.email from the agent's input, payload.email
    json.name from the agent's input, payload.name
    json.company from the agent's input, payload.company
    json.company_website from the agent's input, payload.company_website
    set
    method POST
    secret
    token the stored secret crm-api-key
    returns
    crm_status
    Ivy Node
  6. 06
    Tell the sales channel
    ivy.node.http-request

    Sends one HTTP request to a URL and returns the status, headers and body, parsed as JSON when the response is JSON.

    Runs only on the then branch of step 4.

    takes
    json.text from step 3, text
    set
    method POST
    secret
    url the stored secret slack-webhook-url
    Ivy Node
  7. 07
    Mark the lead low priority
    ivy.node.http-request

    Sends one HTTP request to a URL and returns the status, headers and body, parsed as JSON when the response is JSON.

    Runs only on the else branch of step 4.

    takes
    url from the agent's input, leads_url
    json.email from the agent's input, payload.email
    json.site_title from step 1, title
    set
    method PATCH
    secret
    token the stored secret saas-api-key
    returns
    saas_status
    Ivy Node

Nodes it brings

Adding this agent in IVYX Studio adds these nodes with it. A node your workspace already has is kept as it is, even at another version.

What it touches

Collected from what each of its nodes declares, plus the model call when a step is a model turn. A declaration is the author's statement, and it is what policy rules select on.

Network

What it needs

  • A stored secret named crm-api-key. The agent's file carries the name, never the value.
  • A stored secret named jev-api-key. The agent's file carries the name, never the value.
  • A stored secret named saas-api-key. The agent's file carries the name, never the value.
  • A stored secret named slack-webhook-url. The agent's file carries the name, never the value.

Inputs

FieldTypeDescription
payloadrequiredobjectThe event your service posted: email, name, company and company_website from the form.
crm_urlrequiredstringThe CRM's contacts endpoint; a POST creates a contact. The stand-in's address is used in the cases.
leads_urlrequiredstringYour API's leads endpoint; a PATCH with email and priority marks a lead. The stand-in's address is used in the cases.

Outputs

FieldTypeDescription
qualifiedbooleanTrue when Jev judged the company a business customer.
site_titlestringThe title of the company's site.
crm_statusintegerThe CRM's HTTP status; absent when the lead was not qualified.
saas_statusintegerYour API's HTTP status; absent when the lead was qualified.

Tests

2 of 2 test cases passed on Oct 7, 2026, in the publisher's own environment, before this version was published. The registry keeps that record; it does not run the cases again.

Requires: python:3.9, the stored secret jev-api-key, the CRM's API key stored as the secret crm-api-key, a Slack incoming webhook URL stored as the secret slack-webhook-url, your own API's key stored as the secret saas-api-key, for the cases, the stand-in API on 127.0.0.1:18910 (api-standin.py), which the secrets crm-1, gh-1, saas-1 and the stand-in's /slack/hook address satisfy

  • software-company

    A B2B analytics company's site qualifies the lead: a CRM contact and a Slack line.

    given
    payload {"email":"ada@acme.io","name":"Ada Lovelace","company":"Acme Analytics","company_website":"http://127.0.0.1:18910/pag...
    crm_url http://127.0.0.1:18910/crm/contacts
    leads_url http://127.0.0.1:18910/leads
    expects
    qualified equals true
    site_title equals Acme Analytics
    crm_status equals 201
  • bakery

    A bakery's site does not qualify: the lead is marked low priority.

    given
    payload {"email":"rosa@rosasbakery.example","name":"Rosa","company":"Rosa's Bakery","company_website":"http://127.0.0.1:18910...
    crm_url http://127.0.0.1:18910/crm/contacts
    leads_url http://127.0.0.1:18910/leads
    expects
    qualified equals false
    site_title equals Rosa's Bakery
    saas_status equals 200