OutputValues icon
PushRows icon
If icon
SlackIncomingWebhook icon
Fail icon
Log icon
Schedule icon

Clay CRM Lead Enrichment Dispatch and Delivery Sentinel

Dispatch CRM leads to Clay enrichment tables with chunked delivery, track row acceptance, and alert Slack on partial ingestion failures.

Categories
Business

Orchestrate automated lead dispatch from CRM systems into Clay enrichment tables, monitor chunk delivery acceptance, and instantly catch webhook errors or rejected records before outbound revenue pipelines stall.

Clay is a leading platform for automated data enrichment, waterfalls, and account research. However, in high-volume RevOps pipelines, webhook drops, HTTP 429 rate limit exhaustion, or payload validation errors can silently drop high-value prospects without notice. This blueprint implements an automated delivery sentinel using Kestra's official io.kestra.plugin.clay.PushRows task. It partitions records into controlled batches, respects exponential backoff, verifies that accepted row counts match expectations, and immediately pages RevOps if any chunks fail.

How it works

  1. hourly_enrichment_sweep (io.kestra.plugin.core.trigger.Schedule) initiates scheduled dispatch sweeps every hour.
  2. prepare_qualified_leads (io.kestra.plugin.core.output.OutputValues) structures sanitized prospect records ready for enrichment.
  3. push_leads_to_clay (io.kestra.plugin.clay.PushRows) delivers leads in sequential batches configured by chunk_size, handling Bearer authentication and exponential retries on transient errors.
  4. evaluate_delivery_health (io.kestra.plugin.core.output.OutputValues) inspects rowCount, chunkCount, and failedChunks outputs to determine overall batch health (HEALTHY vs DEGRADED).
  5. route_delivery_findings (io.kestra.plugin.core.flow.If) evaluates the delivery health:
    • If degraded, alert_delivery_failure (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) dispatches a high-priority diagnostic payload to Slack, followed by fail_on_breach (io.kestra.plugin.core.execution.Fail).
    • If healthy, log_successful_delivery (io.kestra.plugin.core.log.Log) records delivery metrics in the audit trail.

What you get

  • Zero lead drop guarantee with automated chunking, rate limit handling, and partial failure detection.
  • Automated classification of delivery status distinguishing fully ingested batches from partial outages.
  • Immediate Slack alerts indicating exact failed chunk counts and rejected rows for fast incident triage.
  • Complete execution audit log for RevOps and Growth engineering compliance.

Who it's for

  • Revenue Operations (RevOps) engineers managing inbound lead enrichment workflows.
  • Growth and demand generation engineers scaling outbound prospecting automations.
  • Data engineers routing sanitized CRM prospects to third-party enrichment providers.

Why orchestrate this with Kestra

  • Declarative Batch Partitioning: The official PushRows plugin natively splits large lead volumes into configurable chunks without requiring bespoke Python batching scripts.
  • Native Reliability Mechanics: Automatic retries with exponential backoff on HTTP 429 and 5xx responses protect against transient rate limiting.
  • Governed Secret Masking: Webhook URLs and Bearer auth tokens remain strictly encrypted inside Kestra secret management.
  • Stateful Observability: Full execution history and payload tracking ensure every lead's journey to Clay is visible and auditable.

Prerequisites

  • A Clay table configured with an inbound webhook source.
  • Outbound HTTPS network access from the Kestra worker to api.clay.com.
  • A Slack incoming webhook URL for notifications.

Secrets

  • CLAY_WEBHOOK_URL: The full inbound webhook URL provided by your Clay table source (e.g., https://api.clay.com/v3/sources/webhook/...).
  • CLAY_AUTH_TOKEN: Optional Bearer authentication token configured on the Clay webhook for authorization.
  • SLACK_WEBHOOK_URL: The Slack incoming webhook URL for RevOps delivery alerts.

Quick start

  1. In Kestra, create namespace secrets CLAY_WEBHOOK_URL, CLAY_AUTH_TOKEN, and SLACK_WEBHOOK_URL.
  2. Import this blueprint into your Kestra instance under namespace company.growth.
  3. Run a manual test execution with default inputs to verify connectivity and Slack alerting.
  4. Enable the hourly_enrichment_sweep trigger or replace prepare_qualified_leads with your upstream database query task.

How to extend

  • Connect Direct Database Feeds: Replace prepare_qualified_leads with io.kestra.plugin.jdbc.postgresql.Query or io.kestra.plugin.snowflake.Query to pull unenriched leads directly from your data warehouse.
  • Reverse Enrichment Sync: Add a downstream task to poll Clay or receive Clay outbound webhooks to sync enriched phone numbers and technographics back into HubSpot or Salesforce.
  • Dynamic Dead-Letter Queue: Route failed chunks into Amazon SQS or Google Cloud Pub/Sub for automated reprocessing.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.