---
title: "CF7 to Webhook: Send Contact Form 7 to n8n"
description: "Complete guide to CF7 to webhook integration. Send Contact Form 7 submissions to n8n with working code, step-by-step setup, and reliable retry on failure."
url: "https://wpwebhooks.org/examples/cf7-to-webhook/"
date: "2026-03-23"
---

[WP Webhooks](https://wpwebhooks.org/) / [Examples](https://wpwebhooks.org/examples/) / CF7 to Webhook

/Example · Contact Form 7

# CF7 to Webhook: Send Contact Form 7 Data to n8n (Step-by-Step)

Setting up a CF7 to webhook integration isn’t built into Contact Form 7. To send form submissions to tools like n8n you need custom code or an additional plugin. This guide covers both approaches — the quick way and the reliable way.

**~10 min read** Mar 23, 2026

contactform7webhookn8n

TL;DR

-   The basic CF7 webhook uses `wpcf7_mail_sent` + `wp_remote_post` — works for low-volume forms but has no retry, no logging, and silently drops failures
-   Access submitted field values via `$submission->get_posted_data()['field-name']` from the `WPCF7_ContactForm` submission object
-   For production: add persistent storage and retry logic so no CF7 submission is lost when the receiving endpoint is temporarily down

/ Basic Method

## Basic CF7 to Webhook Using **wp\_remote\_post**

The most common approach to a CF7 to webhook integration uses the `wpcf7_mail_sent` action hook. Contact Form 7 fires this hook after a successful submission — you hook into it, grab the submitted data, and POST it to your webhook endpoint.

Here’s the minimal working code. Add it to your theme’s `functions.php` or a custom plugin:

functions.php — cf7 to webhook (basic)

```
add_action('wpcf7_mail_sent', function ($contactForm) {
    $submission = WPCF7_Submission::get_instance();

    if (!$submission) {
        return;
    }

    $data = $submission->get_posted_data();

    wp_remote_post('https://your-n8n-url/webhook/test', [
        'headers' => [
            'Content-Type' => 'application/json',
        ],
        'body' => json_encode($data),
    ]);
});
```

This works. It’s simple and widely used. For a hobby project or an internal form with low submission volume, it does the job.

The problem is what happens in production.

/ Production Reality

## Why the Basic CF7 to Webhook Setup **Breaks in Production**

The `wp_remote_post()` approach works in development. The problem shows up once your CF7 to webhook integration is handling real traffic: the call is synchronous, so PHP blocks and waits for the remote server to respond before the form submission completes.

Contact Form 7 has [over 10 million active installations on WordPress.org](https://wordpress.org/plugins/contact-form-7/) — making it one of the most-deployed plugins in the ecosystem. At that scale, silent webhook failure is not an edge case; it accumulates across every site relying on synchronous `wp_remote_post()` without retry logic.

-   × **No retries if the webhook fails.** If n8n is restarting, rate-limiting you, or simply returns a 500 — the delivery attempt is gone. The form appeared to submit successfully but your workflow never ran.
-   × **No logging.** There’s no record of what was sent, when, or what response came back. Debugging a missed submission means checking server logs and hoping the data is still there.
-   × **No visibility into failures.** You won’t know a submission was lost until a lead follows up asking why no one responded. By then it’s too late.
-   × **No way to replay submissions.** Once the HTTP call fails, the data is gone from the delivery context. You can’t re-send it without the user resubmitting the form.
-   × **Slows down form submission for the user.** If your n8n webhook takes 3 seconds to acknowledge, every form submission on your site takes 3 extra seconds. If it times out (default: 5s), users see a hang.

Form submissions can fail silently if the receiving service is down. Without retries, that means lost leads — and no way to know it happened until someone complains.

/ Better Approach

## Reliable Method: **Queue-Based Webhooks** with Retry and Logging

⚡

This example uses [Webhook Actions by Flow Systems](https://wpwebhooks.org/wordpress-webhook-plugin/) — a free WordPress plugin that provides reliable webhook delivery with automatic retry and replay support. It works by queuing webhook dispatch as a background job, so your form submissions are never blocked by a slow or unavailable endpoint.

A reliable CF7 to webhook setup separates two things the basic approach conflates: **recording that a submission happened** and **delivering it to the endpoint**.

When a CF7 form is submitted, a background job is queued immediately. The user gets an instant response — the form submission is complete from their perspective. A cron worker then picks up the job and attempts delivery in the background.

If the delivery fails — because n8n returned a 5xx, hit a rate limit (429), or simply timed out — the job is scheduled for retry with exponential backoff: 1 min, 2 min, 4 min, 8 min, 16 min. Each attempt is logged with the HTTP status code and response body. You can see every success and failure in the WordPress admin.

If all retry attempts are exhausted, the job enters a failed state — visible in the event log, and [replayable via the REST API](https://wpwebhooks.org/webhook-wordpress-plugin-api/) or the admin UI. No data is lost.

FIG 01 — CF7 → Webhook Actions → n8n

/ Setup

## Step-by-Step: CF7 to Webhook Setup  
with **Retry and Logging**

1.  1
    
    **Install the plugin**
    
    Search for this exact description in **Plugins → Add Plugin** — it narrows the WordPress.org search to exactly one result:
    
    search text — paste into WordPress plugin search
    
    ```
    FlowSystems
    ```
    
2.  2
    
    **Create a new webhook**
    
    Go to **Webhooks → Add Webhook** in the WordPress admin. Give it a name (e.g., “CF7 → n8n”).
    
3.  3
    
    **Select the trigger**
    
    Set the WordPress action hook to `wpcf7_mail_sent`. This fires once per successful CF7 form submission.
    
    action hook — paste into the trigger field
    
    ```
    wpcf7_mail_sent
    ```
    
    Webhook Actions admin — searching “sent” and selecting the `wpcf7_mail_sent` hook under Contact Form 7
    
4.  4
    
    **Set the webhook URL**
    
    Paste your n8n webhook URL (e.g., `https://your-n8n-url/webhook/test`). The plugin will POST form data to this endpoint on every submission.
    
5.  5
    
    **Save and test**
    
    Submit your Contact Form 7 form. Check the **Event Log** in the plugin admin to see the delivery status and the payload that was sent.
    
    Webhook Actions by Flow Systems event log — Contact Form 7 submission queued via `wpcf7_mail_sent`, delivery status pending
    

/ n8n

## Setting Up the **n8n Webhook**

On the n8n side, you need a **Webhook** node configured to receive POST requests:

1.  1
    
    **Add a Webhook node**
    
    In your n8n workflow, add a new node and search for “Webhook”.
    
2.  2
    
    **Set HTTP Method to POST**
    
    The plugin sends a JSON POST request, so make sure the Webhook node is set to accept `POST`.
    
3.  3
    
    **Copy the webhook URL**
    
    n8n will generate a URL like `https://your-n8n-url/webhook/test`. Copy this and paste it into the plugin’s webhook URL field (step 4 above).
    
    n8n Webhook node — copy the webhook URL and paste it into the Webhook Actions by Flow Systems plugin to receive CF7 form submissions
    
4.  4
    
    **Activate and test**
    
    Click “Listen for test event” in n8n, then submit your CF7 form. n8n will display the incoming payload so you can map the fields to subsequent nodes.
    
    Full walkthrough — CF7 form submission triggers a webhook payload delivered to n8n via Webhook Actions by Flow Systems
    

/ Payload

## Example **Payload**

Here’s what a typical CF7 submission looks like when it arrives at your n8n webhook. The field names match the **name attributes** you set in your CF7 form tags.

POST body — application/json

```
{
  "event": {
    "id": "085cc108-654f-4b26-b39e-921cc8208bbd",
    "timestamp": "2026-03-23T12:59:21Z",
    "version": "1.0"
  },
  "hook": "wpcf7_mail_sent",
  "args": [
    {
      "__type": "WPCF7_ContactForm",
      "id": 16,
      "title": "Contact form 1",
      "name": "contact-form-1",
      "locale": "en_US",
      "submission": {
        "fields": {
          "your-name": "Mateusz",
          "your-email": "mateusz@wpwebhooks.org",
          "your-subject": "CF7 to webhook test",
          "your-message": "Testing integration"
        },
        "meta": {
          "url": "https://webhook-actions.local/cf-7-example/",
          "timestamp": 1774270761,
          "remote_ip": "172.22.0.1",
          "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36",
          "container_post_id": 17,
          "current_user_id": 0
        }
      }
    }
  ],
  "timestamp": 1774270761,
  "site": {
    "url": "https://webhook-actions.local"
  }
}
```

The payload wraps the full `WPCF7_ContactForm` object including submitted `fields`, page `url`, `remote_ip`, and `user_agent`. Use `args[0].submission.fields` in n8n to access form values directly.

/ Advanced

## Advanced: Retry and Debug **Failed Submissions** via API

Every webhook delivery attempt is stored in the event log — success or failure. If a CF7 submission didn’t reach n8n, you can replay it without asking the user to resubmit.

The plugin exposes a [REST API](https://wpwebhooks.org/webhook-wordpress-plugin-api/) for this:

retry a failed delivery

```
POST /wp-json/fswa/v1/logs/{id}/retry

// Response
{
  "success": true,
  "message": "Retry queued"
}
```

Replace `{id}` with the log entry ID visible in the Event Log. This re-queues the exact payload that was originally sent — no need to reconstruct it.

You can also trigger retries from the WordPress admin UI. Both options are covered in the [REST API documentation](https://wpwebhooks.org/webhook-wordpress-plugin-api/).

Webhook Actions event log — failed CF7 webhook delivery with a retry action to re-queue the submission without asking the user to resubmit

/ Real-World Reliability

## Why Your CF7 to Webhook Integration  
Needs **Retry Support**

A contact form submission is often a high-intent signal — someone typing their email and pressing send is more committed than a page view. Losing that data silently is costly.

With a bare `wp_remote_post()` call, any of these common scenarios causes permanent data loss:

n8n restarts during deployment. Your instance hits a memory limit and returns 500. The incoming webhook URL changes and the old one starts returning 404. A rate limit is hit during a campaign burst.

None of these are edge cases in real production environments. A queue with retries means these scenarios become recoverable failures instead of silent data loss. The event log means you can diagnose and replay — instead of guessing.

Exponential backoff is the industry-standard approach for retryable HTTP operations. [Google Cloud's retry-strategy documentation](https://cloud.google.com/storage/docs/retry-strategy) describes truncated exponential backoff, where spacing retries progressively further apart — rather than at fixed intervals — reduces load on a recovering service and improves overall delivery success rates for transient failures.

**Without retries, a single n8n restart during business hours can mean lost leads.** With retry and replay support, the same event becomes a recoverable blip — automatically resolved within minutes.

/Notes

→ [WordPress Webhooks: Setup, Examples, and Why They Fail](https://wpwebhooks.org/wordpress-webhooks/) — complete guide to how WordPress webhooks work and why they break

→ [Webhook Actions by Flow Systems](https://wpwebhooks.org/wordpress-webhook-plugin/) — plugin overview

→ [From do\_action to HTTP](https://wpwebhooks.org/blog/wordpress-webhook-delivery-engineering/) — how Contact Form 7 hooks are discovered, submission objects normalized, and payloads built

→ [WordPress Webhook REST API](https://wpwebhooks.org/webhook-wordpress-plugin-api/) — retry and replay documentation

→ [Why WP-Cron is not enough for production webhook delivery](https://wpwebhooks.org/blog/async-webhooks-wordpress-wp-cron-not-enough/)

→ [Why WordPress webhooks silently fail in production](https://wpwebhooks.org/blog/why-wordpress-webhooks-silently-fail-in-production/)

→ [Contact Form 7 to Webhook: wpcf7\_before\_send\_mail, field mapping, and retry on failure](https://wpwebhooks.org/blog/contact-form-7-webhook/)

→ [All WordPress webhook automation examples](https://wpwebhooks.org/examples/)

/FAQ

## Common questions always ask.

Don't see yours? Open an issue on GitHub or check the full reference in the API docs.

How do I connect CF7 to a webhook? +

To connect CF7 to a webhook, hook into the wpcf7\_mail\_sent action and use wp\_remote\_post() to send submitted data to your endpoint. For production use, a queue-based plugin like Webhook Actions by Flow Systems gives you automatic retries, delivery logging, and replay — so no form submission is ever lost silently.

Does Contact Form 7 support webhooks? +

Not natively. Contact Form 7 doesn't include a built-in webhook feature. To send form data to a webhook endpoint you need custom code using the wpcf7\_mail\_sent action hook, or a plugin that handles webhook dispatch for you.

How do I send Contact Form 7 data to n8n? +

Hook into the wpcf7\_mail\_sent action, retrieve submitted data via WPCF7\_Submission::get\_instance(), and post it to your n8n webhook URL using wp\_remote\_post(). For reliable delivery with retries, use a queue-based plugin like Webhook Actions by Flow Systems that handles failures automatically.

What happens if my n8n webhook is down when CF7 submits? +

With a bare wp\_remote\_post() call, the data is lost silently — there's no retry and no log entry. With a queue-based system, the failed delivery is stored and retried automatically with exponential backoff (1 min, 2 min, 4 min, 8 min, 16 min). You can also replay any failed submission manually from the WordPress admin.

Can I retry failed CF7 webhook submissions? +

Yes, if you use a plugin that provides retry support. The Webhook Actions by Flow Systems plugin retries failed deliveries automatically and also exposes a REST API endpoint (POST /wp-json/fswa/v1/logs/{id}/retry) that lets you replay any past submission — even successful ones.

Does wp\_remote\_post slow down Contact Form 7 submissions? +

Yes. wp\_remote\_post() is synchronous — PHP blocks and waits for the remote server to respond before the form submission completes. If your n8n instance is slow or unavailable, users will experience a delayed or failed form submission. A queue-based approach dispatches the webhook in the background so the user sees an instant response.

/More examples

## Related integrations.

Gravity Forms

Send Gravity Forms Submissions to a Webhook (n8n Example)

Gravity Forms doesn't support webhooks natively. Here's how to send form submissions to n8n reliably — with retries and a full event log.

[Read →](https://wpwebhooks.org/examples/gravity-forms-webhooks/)

IvyForms

Send IvyForms Submissions to a Webhook (n8n Example)

IvyForms doesn't support webhooks natively. Here's how to send form submissions to n8n reliably — with retries and a full event log.

[Read →](https://wpwebhooks.org/examples/ivyforms-to-webhook/)

WooCommerce

WooCommerce Order Webhook with Claude Code

Ask Claude Code to set up a WooCommerce order webhook — it figures out the right hooks and configures delivery end-to-end.

[Read →](https://wpwebhooks.org/examples/woocommerce-order-webhook-claude-code/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"Article","headline":"CF7 to Webhook: Send Contact Form 7 to n8n","description":"Complete guide to CF7 to webhook integration. Send Contact Form 7 submissions to n8n with working code, step-by-step setup, and reliable retry on failure.","datePublished":"2026-03-23","dateModified":"2026-03-23","author":{"@type":"Person","name":"Mateusz Skorupa","url":"https://wpwebhooks.org/about/"},"publisher":{"@type":"Organization","name":"WP Webhooks","url":"https://wpwebhooks.org","sameAs":["https://flowsystems.pl"]},"url":"https://wpwebhooks.org/examples/cf7-to-webhook/","image":{"@type":"ImageObject","url":"https://wpwebhooks.org/examples/cf7-to-webhook/og_image.jpg"},"keywords":["cf7 to webhook","cf7 webhook","contact form 7 webhook","contact form 7 to webhook","send cf7 to api","contact form 7 n8n","cf7 wp_remote_post","wordpress form webhook"]}

{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How do I connect CF7 to a webhook?","acceptedAnswer":{"@type":"Answer","text":"To connect CF7 to a webhook, hook into the wpcf7_mail_sent action and use wp_remote_post() to send submitted data to your endpoint. For production use, a queue-based plugin like Webhook Actions by Flow Systems gives you automatic retries, delivery logging, and replay — so no form submission is ever lost silently."}},{"@type":"Question","name":"Does Contact Form 7 support webhooks?","acceptedAnswer":{"@type":"Answer","text":"Not natively. Contact Form 7 doesn't include a built-in webhook feature. To send form data to a webhook endpoint you need custom code using the wpcf7_mail_sent action hook, or a plugin that handles webhook dispatch for you."}},{"@type":"Question","name":"How do I send Contact Form 7 data to n8n?","acceptedAnswer":{"@type":"Answer","text":"Hook into the wpcf7_mail_sent action, retrieve submitted data via WPCF7_Submission::get_instance(), and post it to your n8n webhook URL using wp_remote_post(). For reliable delivery with retries, use a queue-based plugin like Webhook Actions by Flow Systems that handles failures automatically."}},{"@type":"Question","name":"What happens if my n8n webhook is down when CF7 submits?","acceptedAnswer":{"@type":"Answer","text":"With a bare wp_remote_post() call, the data is lost silently — there's no retry and no log entry. With a queue-based system, the failed delivery is stored and retried automatically with exponential backoff (1 min, 2 min, 4 min, 8 min, 16 min). You can also replay any failed submission manually from the WordPress admin."}},{"@type":"Question","name":"Can I retry failed CF7 webhook submissions?","acceptedAnswer":{"@type":"Answer","text":"Yes, if you use a plugin that provides retry support. The Webhook Actions by Flow Systems plugin retries failed deliveries automatically and also exposes a REST API endpoint (POST /wp-json/fswa/v1/logs/{id}/retry) that lets you replay any past submission — even successful ones."}},{"@type":"Question","name":"Does wp_remote_post slow down Contact Form 7 submissions?","acceptedAnswer":{"@type":"Answer","text":"Yes. wp_remote_post() is synchronous — PHP blocks and waits for the remote server to respond before the form submission completes. If your n8n instance is slow or unavailable, users will experience a delayed or failed form submission. A queue-based approach dispatches the webhook in the background so the user sees an instant response."}}]}

{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://wpwebhooks.org/"},{"@type":"ListItem","position":2,"name":"Examples","item":"https://wpwebhooks.org/examples/"},{"@type":"ListItem","position":3,"name":"CF7 to Webhook: Send Contact Form 7 Data to n8n","item":"https://wpwebhooks.org/examples/cf7-to-webhook/"}]}

{"@context":"https://schema.org","@type":"HowTo","name":"How to Send Contact Form 7 Submissions to n8n via Webhook","description":"Set up a reliable Contact Form 7 to n8n webhook integration with automatic retry and delivery logging.","step":[{"@type":"HowToStep","name":"Set up the n8n webhook trigger","text":"In n8n, create a new workflow and add a Webhook node. Copy the webhook URL — this is the endpoint CF7 will POST to on every form submission."},{"@type":"HowToStep","name":"Install the Webhook Actions plugin","text":"Download and activate the Flow Systems Webhook Actions plugin from the WordPress plugin directory. It adds async queue delivery and automatic retry to any webhook."},{"@type":"HowToStep","name":"Configure the CF7 webhook in WordPress","text":"In the plugin settings, create a new webhook: set the endpoint URL to your n8n webhook URL and add wpcf7_mail_sent as a trigger. Enable the webhook."},{"@type":"HowToStep","name":"Map the Contact Form 7 payload","text":"Use the plugin's payload mapping to extract form fields from the CF7 submission data and format them as a clean JSON payload for n8n."},{"@type":"HowToStep","name":"Test the integration and verify delivery logs","text":"Submit the contact form and check the plugin's delivery log for a 200 response from n8n. If the delivery failed, use the retry button or POST /wp-json/fswa/v1/logs/{id}/retry via the REST API."}]}

{"@context":"https://schema.org","@graph":[{"@type":"VideoObject","@id":"https://wpwebhooks.org/examples/cf7-to-webhook/#video-walkthrough","name":"Contact Form 7 to Webhook — End-to-End Walkthrough","description":"Full walkthrough — CF7 form submission triggers a webhook payload delivered to n8n via Webhook Actions by Flow Systems","contentUrl":"https://wpwebhooks.org/examples/cf7-to-webhook/cf7_to_webhook.mp4","thumbnailUrl":"https://wpwebhooks.org/videos/thumbnails/cf7_to_webhook.webp","uploadDate":"2026-04-07T00:00:00+00:00","duration":"PT15S"}]}
```
