HTTP Trigger
An HTTP trigger allows you to start a workflow using a POST request. Arguments to the background job can be provided in the URL query string or HTTP POST body. If both are provided, they are merged and encoded into JSON.
When the workflow runs, actions can retrieve the job arguments from environment variables.
Triggering a Job
Submitting a job to ExecAPI can be done using various programming languages and libraries. Here are some examples in curl, node.js using fetch, and Python using requests:
- curl
- Node.js
- Python
curl -d '{"message": "hello from curl"}' \
-H "Content-Type: application/json" \
https://YOUR-PROJECT-ID.user.execapi.com/PATH
const fetch = require("node-fetch");
(async () => {
const res = await fetch("https://YOUR-PROJECT-ID.user.execapi.com/PATH", {
method: "POST",
body: JSON.stringify({ message: "hello from node.js" }),
headers: { "Content-Type": "application/json" },
});
const data = await response.json();
console.log(data);
})();
import requests
response = requests.post(
'https://YOUR-PROJECT-ID.user.execapi.com/PATH',
json={'message': 'hello from python'},
headers={'Content-Type': 'application/json'}
)
print(response.json())