Build an n8n lead generation workflow with Dievio
Use Dievio’s B2B lead search API in n8n. Set up an HTTP Request, send results to Google Sheets or download a starter workflow.
Set up the search in your own n8n workspace
Start with an HTTP Request
Connect a Manual Trigger to an HTTP Request node. Set the method to POST and use https://dievio.com/api/public/search.
Connect a credential
In the HTTP Request node, choose Generic Credential Type and Header Auth. Set the header name to X-API-Key and use your Dievio API key. Enable the JSON request body.
Test one record
Paste the body below. Check success and preview_data in the output before connecting a destination. The limit is one result.
{
"company_websites": ["stripe.com"],
"job_titles": ["Founder"],
"include_emails": true,
"email_status": "work",
"include_phones": false,
"_page": 1,
"_per_page": 1,
"max_results": 1
}Use email_status: "work" to require a stored address in work_email. Check deliverability separately if your workflow needs it. See the Search API filters.
The search uses one API credit per returned record. The response places the matching rows in preview_data. A successful request with an empty array uses zero credits.
To retry a search after a timeout, add Idempotency-Key under Send Headers before the first request. Generate a unique key per page and reuse it with the same request body within one hour. See the Search API retry rules.
Append returned rows to Google Sheets
- Run the next steps when
preview_datacontains at least one item. In Split Out, set Field to Split Out topreview_dataand set Include to No Other Fields. - Use Edit Fields to keep the columns you need, such as
full_name,company,job_titleandwork_email. - Connect a Google Sheets node set to Append Row. Select your Google credential, spreadsheet and tab. Add matching column headers in Sheets and map the fields.
Check that your test row reached the intended tab before using a schedule or a webhook. If the Sheet write fails after a successful API call, check the n8n execution before repeating the search.
Import the webhook starter workflow
Use Import from File and select the downloaded JSON. Set X-Webhook-Secret on Webhook In and X-API-Key on Run Dievio Search as separate Header Auth credentials. Set the spreadsheet ID and tab name in Prepare Request and connect your Google Sheets credential to the append node.
Set up the first row of the target tab with the headers below, one header per column.
request_id,collected_at,first_name,last_name,full_name,job_title,company,city,state,country,work_email,email_status,mobile_phone,phone_status,linkedin_url,linkedin_status,twitter_status,facebook_statusThe starter workflow imports as inactive and sends one page per run. It was tested on n8n 2.1.4. To verify your Google Sheets connection, use Listen for test event and run one result in your test tab before activating the webhook.
curl "$N8N_TEST_WEBHOOK_URL" \
-H "X-Webhook-Secret: $N8N_WEBHOOK_SECRET" \
-H "Content-Type: application/json" \
--data '{"maxResults":1,"emailStatus":"work","filters":{"company_websites":["stripe.com"],"job_titles":["Founder"]}}'The webhook example uses emailStatus: "work" to require a work email. Check for a new row in the expected tab and writtenRows: 1 when a match is found. If the response shows writtenRows: 0, try a different company or title. The workflow skips the Sheets node when there are no matches. Each webhook call starts a separate search. Check the previous execution before resending it after an error.
n8n integration questions
If your workflow starts an Apify Actor, follow the guide to run an Apify Actor and retrieve its Dataset over HTTP.
Where does this workflow run?
You import or build the workflow in your own n8n workspace. That workspace calls the Dievio API and writes the results using your Google Sheets connection.
How much does a test run cost?
The example requests up to one lead. A returned lead uses one API credit, and an empty result uses zero. API credits are separate from subscription credits.
What if I already have LinkedIn profile URLs?
Use the LinkedIn Lookup API for a list of public profile URLs. The search request on this page discovers contacts using filters.
Start with one search result
Create a Dievio API key and connect it to your n8n workflow.