New to Kestra?
Use blueprints to kickstart your first workflows.
Ingests inbound corporate leads, searches company firmographics via Perplexity AI, and routes high-value enterprise prospects to Slack.
When prospective customers submit demo requests or trial signup forms, traditional enrichment providers (such as Clearbit or ZoomInfo) frequently have coverage gaps on high-growth startups, international organizations, or stealth companies. Furthermore, static database records quickly become outdated regarding recent venture rounds, acquisitions, and executive leadership shifts.
By orchestrating Perplexity AI's real-time web-grounded search models (sonar) within Kestra, marketing and sales teams can retrieve real-time firmographic intelligence for any inbound domain within seconds.
This blueprint listens for inbound lead form submissions via Webhook, prompts Perplexity to search the live web for verified company size, industry vertical, headquarters, and funding status, persists the enriched profile into PostgreSQL, and immediately routes high-value enterprise accounts to sales teams via Slack.
inbound_lead_webhook trigger (io.kestra.plugin.core.trigger.Webhook) activates immediately upon form submission.research_company_via_perplexity task (io.kestra.plugin.perplexity.ChatCompletion) queries the sonar model to conduct web research and return structured JSON.parse_firmographic_data task (io.kestra.plugin.scripts.python.Script) validates fields, evaluates enterprise qualification thresholds, and outputs lead_profile.json.evaluate_enterprise_tier flowable task (io.kestra.plugin.core.flow.If) branches based on whether the lead meets enterprise size criteria.alert_enterprise_sales_lead (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) delivers an actionable briefing card to the sales team.persist_lead_to_database task (io.kestra.plugin.jdbc.postgresql.Query) saves the enriched record to PostgreSQL with idempotent upsert logic.export_lead_manifest task returns execution metadata for marketing analytics.flowchart TD
A[Trigger: Inbound Webhook] --> B[research_company_via_perplexity: Perplexity Sonar]
B --> C[parse_firmographic_data: Python Classifier]
C --> D{Enterprise Tier Lead?}
D -- Yes --> E[alert_enterprise_sales_lead: Slack]
D -- No --> F[log_standard_lead_tier: Log]
E --> G[persist_lead_to_database: PostgreSQL]
F --> G
G --> H[export_lead_manifest: Return JSON]
Connecting web forms, generative search APIs, relational databases, and Slack typically requires brittle serverless functions. Kestra consolidates webhook ingestion, real-time AI inference, database upserts, and team notifications into a single observable workflow.
| Name | Type | Default | Description |
|---|---|---|---|
lead_email |
STRING | alex.taylor@stripe.com |
Prospect contact email address. |
company_name |
STRING | Stripe |
Company name to investigate. |
postgres_url |
STRING | jdbc:postgresql://... |
JDBC URL for CRM storage. |
postgres_username |
STRING | crm_writer |
Database user for upsert queries. |
slack_channel |
STRING | #sales-leads |
Slack channel destination for alerts. |
{{ outputs.parse_firmographic_data.vars.is_enterprise }}: Boolean flag indicating if company headcount >= 500.{{ outputs.parse_firmographic_data.vars.industry }}: Business vertical identified via web search.{{ outputs.parse_firmographic_data.vars.employees }}: Estimated employee count.{{ outputs.parse_firmographic_data.outputFiles['lead_profile.json'] }}: Complete JSON diagnostic report.inbound_leads table.PERPLEXITY_API_KEY: API key for Perplexity AI web search inference.POSTGRES_PASSWORD: Password for the PostgreSQL database user.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL.PERPLEXITY_API_KEY, POSTGRES_PASSWORD, and SLACK_WEBHOOK_URL in your Kestra namespace secrets.sonar model.inbound_leads table exists in PostgreSQL with a unique constraint on the email column for upsert handling.io.kestra.plugin.hubspot.ContactCreate to automatically sync enriched leads into HubSpot CRM.