Webhook executions
Webhooks are endpoints that you can provide to other external ecosystems.
This is very handy because it allows you to trigger actions in your process from external systems.
Configuration
From the process page, you may find the triggers section on the right sidebar.

Once you press the Add +
button, you can create a webhook passing optional authentication params. If you don't provide an user and password, no autentication would be needed to start the process, so take care about it!

After creating the webhook, you can see the generated URL link and cURL command.

Congrats! Your webhook is ready for external requests.
Invoking webhooks externally
Make an http GET
or POST
to test your configured webhook, use a tool like Postman, Insomnia or curl
in your terminal.
Payloads passed from request body are included in YepCode parameters.
For example, this implementation would perform a echoes from provided parameters:
JavaScript
Python
// my echo process
const {
context: { parameters },
} = yepcode;
return parameters;
# my echo process
parameters = yepcode.context.parameters
return parameters;
Invoke it using curl
from terminal with some parameters:
curl -X GET -H "Content-Type: application/json" \
https://cloud.yepcode.io/api/yepcode-playground/webhooks/e0589ff5-2e4e-4f82-9ae4-dca83801f333?name=John%20Doe
# {"name":"John Doe"}
The same example using POST
, parameters in POST
are passed as request body:
curl -X POST -H "Content-Type: application/json" -d '{"name": "John Doe"}' \
https://cloud.yepcode.io/api/yepcode-playground/webhooks/e0589ff5-2e4e-4f82-9ae4-dca83801f333
# {"name":"John Doe"}
Request headers
- Yep-Version-Tag: Specify your process version tag to run a concrete version of your process. (optional)
- Yep-Async: Choose to run the webhook synchronously or asynchronously. Sync executions will wait the process to finish before returning the response, while async executions will respond instantly with 201 http code and a JSON informing about execution id. (optional) default:false
All request headers sent to a webhook are available in yepcode.context.request.headers
. You could access them and use their values as you please.
For example we could send a header signature to improve our process security:
curl --location --request POST 'https://cloud.yepcode.io/api/your-team/webhooks/your-process-id' \
--header 'Content-Type: application/json' \
--header 'YepCode-Signature: yp_test_y4Fb38t5RngUZiZSzFC4c4lZHFKHcC'
And validate that signature matches in the process:
JavaScript
Python
const {
context: { request },
} = yepcode;
if (
request.headers["yepcode-signature"] !==
"yp_test_y4Fb38t5RngUZiZSzFC4c4lZHFKHcC"
) {
return {
status: 400,
body: {
error: {
message:
"Invalid signature. Double check the 'YepCode-Signature' header",
},
},
};
}
request = yepcode.context.request
if request.get("headers", {}).get("yepcode-signature", "") != "yp_test_y4Fb38t5RngUZiZSzFC4c4lZHFKHcC":
return {
"status": 400,
"body": {
"error": {
"message":
"Invalid signature. Double check the 'YepCode-Signature' header",
},
},
};
Query parameters
- async: Same as Yep-Async header. It takes precedence over the header. (optional) default:false
Response headers
- Yep-Execution-ID: All requests to webhooks returns this header indicating the execution id.
- Location header: async executions returns this header indicating the location of the execution.
Tips & examples
The response for async executions (when you set Yep-Async: true or async query param is true) will contain a Location header with the url of the execution
Here you have some sample requests with a sandbox process:
curl --location --request POST 'https://cloud.yepcode.io/api/sandbox/webhooks/35a421c3-e818-4dc1-9be3-9ab6db2c1306' \
--header 'Yep-Async: true'
curl --location --request POST 'https://cloud.yepcode.io/api/sandbox/webhooks/35a421c3-e818-4dc1-9be3-9ab6db2c1306?async=true' \
curl --location --request POST 'https://cloud.yepcode.io/api/sandbox/webhooks/35a421c3-e818-4dc1-9be3-9ab6db2c1306' \
--header 'Yep-Version-Tag: v1.0.0' \
--header 'Yep-Async: false'
curl --location --request POST 'https://cloud.yepcode.io/api/sandbox/webhooks/35a421c3-e818-4dc1-9be3-9ab6db2c1306' \
--header 'Yep-Async: false'
curl --location --request POST 'https://cloud.yepcode.io/api/sandbox/webhooks/35a421c3-e818-4dc1-9be3-9ab6db2c1306?async=false' \
You can come back to this information in Copy options
in webhook menu.
