Webhooks support
Coupler.io supports incoming and outgoing webhooks:
- Incoming webhooks allow launching the data flow by API request.
- Outgoing webhooks allow executing an API call after a data flow run was finished.
Coupler.io allows you to generate a webhook URL for any data flow and add up to 3 outgoing webhooks to any data flow. Using webhooks, you can cover different business cases, such as:
- Building a sequence of Coupler.io data flows so they execute one after another
- Sending a custom POST request after your data flow is executed.
- Notifying your system about data flow execution (along the webhook URL that you define, we also send the request body with data flow id, status, and error message (if any)).
Request body examples:
=== Successfull === { "status":"success", "workflow_id":"acffe262-756d-11ed-9b52-9f316d1f365f" } === Failed === { "error_message":"1 out of 2 sources have failed. Check details for more information", "status":"error", "workflow_id":"d758099c-5513-11ed-bbab-5759c0240d23" }
How to generate a data flow webhook
You need to generate a data flow webhook, so that later you can trigger the data flow run by sending a POST request with this webhook URL.
Coupler.io users can generate a webhook for any data flow in their account via the following steps:
Find the needed data flow in the list and click "See details":
Scroll down until the “data flow webhook” section and click the "Generate webhook" button:
Copy the generated webhook URL by clicking on the "Copy" icon:
How to change the data flow webhook URL
There are situations when you may want to change the webhook URL. For example, you shared it with a team member who is leaving the company and you need to ensure their access is revoked. You can do this from the data flows' page.
Please be aware that once you change the data flow webhook URL, the old webhook URL will not work anymore.
To change the webhook, please follow the next steps:
Find the needed data flow in the list and click "See details":
Scroll down to the “Data flow webhook section” and click the "Update webhook" icon:
Confirm that you want to change the webhook URL by clicking the “Change” button:
Copy the new webhook URL by clicking on the "Copy" icon::
How to trigger a data flow run with a webhook
Once you’ve set up the data flow webhook URL, you need to execute a POST request with that URL to run the data flow.
For example, the webhook URL for your data flow is as follows: https://app.coupler.io/w/execute/1a53f56c-4001-11ed-97b8-afbee7b3887b-4f8f92db-572d-488f-abcc-8f80e5c61141, so to trigger the data flow, you need to execute the following request:
curl --request POST 'https://app.coupler.io/w/execute/1a53f56c-4001-11ed-97b8-afbee7b3887b-4f8f92db-572d-488f-abcc-8f80e5c61141'
If execution starts - you will receive the response status code 200 and the following response body:
{ "id": "<execution_id>", "last_run_at": "YYYY-MM-DDThh:mm:ss", "last_error_message": null or "<error_message>" if any }
If the response is different, it could be that the webhook URL is outdated, or you have reached your account limits (e.g., runs), etc. Please contact Coupler.io support, so we can help you define the root cause and fix the issue.
How to set up outgoing webhooks
To set up an outgoing webhook, please follow these steps:
- Open the view page of the data flow you want to use as a trigger.
- In the "Outgoing webhook" section at the bottom of the page, enter the webhook URL (you can add up to three different webhook URLs)
And that's it!
Please be aware that for the proper functioning of the webhooks, your URL should be:
- Valid (starting from https:// or http://).
- Unique (You cannot add the same webhook URL twice to the same data flow. You can, however, use the same webhook URL across different data flows).
If you enter a valid URL, but the request itself is wrong (requires GET method, has missing parameters, etc.), Coupler.io will still send this request, but you will not get the correct result.
FAQ
Can I trigger a run for the same data flow manually, on schedule, and by webhook?
Yes. You can, for example, run a data flow according to a certain schedule and when you need, also launch it manually and/or via a webhook. The only difference in such runs is that scheduled runs do not refresh your destination data in case the source has no new/updated data (read more here).