Getting Started
Combining your Gumloop flows with webhook triggers allows you to build APIs visually with no code!
Webhooks
All Gumloop flows can be triggered via your own external app using Webhooks.
To see the code necessary to trigger your flow, navigate to your flow and click the ‘Your Triggers’ on the left side of the pipeline builder.
Select the option ‘Webhook’ and your preffered language.
Inputs
Most useful flows require an input in from the user. Many flows require multiple. Inputs are defined using Input nodes and these inputs can be passed in using webhooks as well!
The following example takes in 3 seperate inputs and sends an email. The inputs represent the recipients email, the email subject and the email body.
The ‘input_name’ values represent the id of that input field. These input names are used to map the information you send via the webhook to the appropriate nodes.
The inputs are sent in the JSON body in an attribute pipeline_inputs
. This attribute is a list containing JSON objects with two key-value pairs, one representing the input_name
and one representing the value
to be passed in for the input.
The following is an example of how you would populate these 3 expected fields in an api call (cURL request).
Here is the same request in Python using the requests
library:
And here is the same request in JavaScript using the fetch
API:
Outputs
When you run a Gumloop pipeline remotely, the POST request to https://api.gumloop.com/api/v1/start_pipeline
will return a run_id
and a URL that links to the flow run.
Here is an example of the response:
You can use this run id to poll a separate endpoint to get information about the ongoing run like the status, logs, and outputs when it is completed.
In order to poll, make a GET
request to https://api.gumloop.com/api/v1/get_pl_run
with run_id as a query parameter.
Here is an example of a GET request with cURL, Python, JavaScript and their outputs:
Request with cURL
Request with Python
Request with JavaScript
Output
The key attributes here are log
, state
, and outputs
.
log
: Contains a running log of each node and the activities within it.
state
: One of “STARTED”, “RUNNING”, “TERMINATED”, “FAILED” or “DONE”.
outputs
: A JSON object with key-value pair where the key is the output name
and the value is the output value
. This will only be populated when your pipeline reaches a “DONE” state and you have named output nodes in your pipeline.