Webhook Step
Send your Member's answers and your workflow's results to another system, such as a CRM or an automation tool, the moment the run reaches the Step.
Send Results Where You Work
A Webhook Step sends data from the run to a web address you choose, such as an inbound webhook in your CRM or automation tool. It sends when the run reaches it, with whatever is ready by then: your Member's answers and the results of earlier Steps. From there, the other system can save it to a contact, email it, tag the person or start a follow-up. Your Members don't see the Step, and a failed send never stops their run.
Before You Start
- Get the address. In the other system, set up whatever receives incoming data. It's often called an inbound webhook, a webhook trigger or a catch hook. Copy the web address it gives you. Treat it like a password: anyone who has it can send data into that account.
- Decide what to send. Choose a short name for each piece, such as
first_name,emailandreport. You'll use the same names on both sides. - Get the workflow working first. Run it with Preview and check that each Step gives you what you want to send.
Add a Webhook Step
Spark doesn't add Webhook Steps, so you add them in the workflow editor.
If Spark built this workflow, a later Spark change replaces every Step, including a Webhook Step you add here. Add it once you're done asking Spark for changes, and add it again after any later Spark change. See What a Spark Change Replaces.
Add the Step where the send should happen
Click Webhook in the Output group of the Steps list. Put it after every Step whose answers or results it sends. See Where to Put It.
Paste the address
Paste the address into URL, exactly as the other system gave it to you.
Choose the method
Leave Method on POST unless the other system asks for GET, PUT, PATCH or DELETE.
Build the request
Under Request, keep Simple and add a row for each piece of data. See Build the Request.
Send a test
Click Send Test Request and check that the other system received it. See Send a Test Request.
Hide from Progress List starts on for a Webhook Step, so your Members never see it. See Step Types.
Where to Put It
A Webhook Step can go anywhere: right after an Opt-In Step, between other Steps, or at the end. It can send only what's ready when the run reaches it.
Many people start a lead magnet and never finish it. To capture every lead, put one Webhook Step right after the Opt-In Step to send the name and email, and another at the end to send the email and the finished result. Send the email both times so the other system can match the second send to the same person. See Opt-In Step.
The run waits while the Step sends. Most sends take a moment. If the other system is slow or busy, ThoughtFlow keeps trying for up to a minute before the run moves on, so a Webhook Step in the middle of a workflow can hold up the next Step for that long.
Build the Request
Request has two ways to build what's sent. Only the one you've chosen is sent. The other is kept, so you can switch back.
Use Simple for most systems.
- Fields: click + Add Field for each piece of data. Type its Name, such as
email, and fill in its Value: click in the box, then Insert Variable, and choose your Member's answer under Input Fields or an earlier Step's result under Step Outputs. You can also type a value, or mix typed text and variables. Names can't contain variables. - Send As: JSON or Form. Use what the other system asks for. Most expect JSON. With JSON, every value is sent as text, numbers included.
- Headers: click Add Header to add one the other system asks for, such as a key. Leave them out if it doesn't ask. Send As sets
Content-Typefor you.
With GET, Simple sends no body, and the panel says "GET requests send no body."
For example, a Simple request after an Opt-In Step might have two fields: first_name with the First Name answer, and email with the Email answer. With JSON, the other system receives:
{
"first_name": "Sam",
"email": "sam@example.com"
}
Use Advanced when the other system needs an exact shape, such as nested data or a number that isn't sent as text.
- Headers (Optional): one per line, as
Name: Value, such asAuthorization: Bearer abc123. - Body: the text to send. Click Insert Variable to add answers and results.
In this example, {{email}} and {{quiz_score}} stand for variables you inserted: an Email answer and a Compute Step's result.
{
"contact": {
"email": "{{email}}",
"source": "Pricing Quiz"
},
"score": {{quiz_score}}
}
In a JSON body:
- Put a variable inside quote marks when it holds text. Quotes and line breaks in the AI's text are handled for you, so they can't break the body.
- Put it outside quote marks only when it always holds a number,
true,falseornull, such as a Compute Step's plain result. - Keep the body valid JSON: commas between lines, none after the last one, and the curly brackets in place.
With no Content-Type header, a body that starts with { or [ is sent as JSON. A form body is encoded for you. Anything else is sent as written. With GET, the body isn't sent.
You can also put variables in the URL, after the first slash, such as https://hooks.example.com/leads/{{email}}. They can't go in the domain. The panel says "Merge fields can't be used in the domain of the URL. Put them after the first slash."
Insert Variable offers your Member's answers and the results of earlier Agent, Compute and Webhook Steps. User Knowledge and the run date aren't offered. A variable with no value is sent empty. See Variables.
Send a Test Request
Click Send Test Request to send what the panel shows now, with sample values in place of the variables: test@example.com for an email field, 42 for a number or a Compute Step, Yes for a checkbox, and sample_ and the variable's name for the rest. It sends once and shows the result under the button: Delivered with the status code, or Failed with the reason. Click Response to see what the other system sent back.
Test requests carry the header X-ThoughtFlow-Test: true. They don't appear in Recent Deliveries.
Many systems need one real example before they let you match the data to contact fields. A test request sends sample values. To send real ones, run the workflow with Preview past the Webhook Step, using your own name and an email you can check.
Check Recent Deliveries
Every real send is listed under Recent Deliveries in the Step's settings: the last 20 from every run, newest first, Preview runs included. Click Refresh to see new ones.
| Status | What it means |
|---|---|
| Delivered | The other system accepted it. |
| Failed | It didn't arrive, or the other system turned it down. The reason shows under it. |
| In Progress | It's still sending. |
| Interrupted | It stopped before it finished. It may have arrived. |
Each row shows how long ago it was sent and how many attempts it took.
To see sends from every Webhook Step in a workflow, open Webhook Deliveries from the workflow's menu on the Workflows list. It lists the last 50, each with its Step's name. When a Step's latest send fails or is interrupted, a red alert icon appears next to the workflow's name: "A webhook delivery failed. Click to see recent deliveries." It goes away once that Step's next send works. See Workflows Overview.
How Sending Works
- Success means the other system answered with a 2xx status code.
- Retries: ThoughtFlow tries up to 3 times when a problem looks temporary, such as the other system being busy or unreachable for a moment. So "2 attempts" on a delivered send is normal. It doesn't retry when the other system turned the send down, or when the request may already have arrived.
- Time limit: each attempt waits up to 30 seconds, and the whole send stops after a minute.
- Redirects aren't followed. Use the final address the other system gives you.
- Addresses: the URL must start with
http://orhttps://, use a domain name, not an IP address, and use the standard ports. Private and internal addresses are refused. - Headers ThoughtFlow adds:
X-ThoughtFlow-Delivery-Id, a different value for each send, which the other system can use to spot repeats. AUser-Agentheader is added unless you set one. - Who it sends for: every run, including your Members, visitors on a share link and your own Preview runs. Each Webhook Step sends once per run.
- A failed send never stops the run. Your Member's run goes on, and their results show as usual.
Use the Response in Later Steps
The panel's last section shows the Step's variable, such as {{send_to_crm}} for a Step named Send to CRM. It holds what the other system sent back, up to 10,000 characters.
The response is filled in only when you or another App Admin or App Editor runs the workflow, such as in Preview. For your Members and share link visitors, it's always empty. Don't build a Step your Members rely on from it.
When a Send Fails
| Reason | What to do |
|---|---|
| "No URL configured. Open this step and add a URL." | Paste the address into URL. |
| "The URL is not valid. Use a full address that starts with http:// or https://." | Copy the full address from the other system again. |
| "HTTP 404 from the receiver." (or another number) | The other system turned the send down. Check the address, and check that whatever receives it is turned on or published. |
| "The domain could not be found." or "Could not connect to the receiver." | The address is mistyped, or the other system can't be reached. Copy the address again. |
| "Redirected to ... Redirects are not followed." | Use the final address the other system gives you. |
| "The receiver did not answer in time. The request may have arrived." | The other system was slow. Check whether it received the data before you send again. |
| "The body is not valid JSON once merge fields are filled in." | In Advanced, look for a missing comma or quote mark, or an extra comma after the last line. |
| "A merge field outside quotes in the JSON body must hold a number, true, false or null." | In Advanced, move the variable inside quote marks. |
| "Merge fields can't be used in the domain of the URL. Put them after the first slash." | Take the variable out of the domain. Send the data in the request instead. |
| "Refused: the address is private or internal." | Use the other system's public address. |
Nothing in Recent Deliveries means the run never reached the Step. Check that it's connected, and that your test ran past it. A field that's empty in the other system usually means the names don't match exactly, or the Webhook Step comes before the Step that fills in that value.