HTTP

Built-in step · 2 steps

Call any REST or GraphQL endpoint, or start a workflow when a web address lists something new.

To learn when to use these steps, with examples, read Call an API or run code.

Call a GraphQL API

Send a query or mutation to any GraphQL API that Lodol has no built-in step for. Write the query as in the API's own explorer, fill in its variables, and the data comes back ready for later steps to read, with any errors the API reported. Store an API token as a workspace secret and reference it in a header.

Inputs

URLurltextRequired
The GraphQL endpoint, starting with https://, such as https://api.github.com/graphql. It can be built from workspace values.
QueryquerytextRequired
The query or mutation to send, written in GraphQL. Declare the values that change as variables, such as query ($id: ID!), and set them below rather than writing them into the query.
Variablesvariablesobject
A value for each variable the query declares, named without the dollar sign. A value can be a reference to an earlier step, or JSON for an object or a list. Put text that looks like a number in quotes, such as "12345".
Operation nameoperation_nametext
Which operation to run when the query holds more than one. Leave it empty for a query with a single operation.
Headersheadersobject
Headers to send, such as an Authorization header. Use a workspace secret for a token so it is never stored in the workflow.
Error responseson_errortext
What an error means for this step: an error status (a 401, a 500) or a reply whose errors list is not empty. Treating them as results lets later steps read the errors themselves and use any data that did come back. A request that gets no answer at all still fails the step; the step's own "If this step fails" setting decides what happens then.One of: fail (Fail the step), continue (Treat them as results). Default: fail.

Outputs

dataobject
errorslist
headersobject
oktrue/false
statusnumber
urltext
Example output
{
  "data": {},
  "errors": [],
  "headers": {},
  "ok": true,
  "status": 1,
  "url": "example_value"
}

Call an API

Call any REST or GraphQL endpoint that Lodol has no built-in step for. Set the method, URL, headers, query parameters, and body, and the response comes back ready for later steps to read. Store an API token as a workspace secret and reference it in a header to make an authenticated call.

Inputs

URLurltextRequired
The full address to call, starting with https://. It can be built from workspace values, for example @values.BASE_URL followed by the path.
Methodmethodtext
The HTTP method the endpoint expects.One of: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Default: GET.
Headersheadersobject
Headers to send, such as an Authorization header. Use a workspace secret for a token so it is never stored in the workflow.
Query parametersqueryobject
Values added to the end of the URL as a query string. Anything already written into the URL is kept.
Bodybodyobject
What to send with the request, as JSON or a reference to a value from an earlier step. Leave it empty for a request that carries no body, such as a GET.
Body formatbody_formattext
How to encode the body. JSON suits most APIs, including GraphQL. Form sends it the way an HTML form would. Multipart uploads files: each field of the body is text, or a file from an upload or an earlier step.One of: json, form, text, multipart (Multipart (files)), none. Default: json.
Response formatresponse_formattext
How to read what comes back. Auto follows the response's own content type, so JSON becomes an object and a download becomes a file.One of: auto, json, text, file. Default: auto.
Error responseson_errortext
What an error status (a 404, a 500) means for this step. Treating it as a result lets later steps check the status themselves, which suits a 404 that just means not found. A request that gets no answer at all still fails the step; the step's own "If this step fails" setting decides what happens then.One of: fail (Fail the step), continue (Treat them as results). Default: fail.
Connectionconnection_idtext
Log in as one of the workspace's connected accounts (a Salesforce, Google or Notion account, ...), which adds that account's credentials for you. For calling an endpoint of a connected app that its actions don't cover. The request can only go to that app's own servers.
Paging typepagingtext
Pick the type your API's docs describe.One of: none (Off), link_header (Link header), next_url (Next-page URL), cursor, page_number (Page number). Default: none.
Results fieldpaging_itemstext
The field in each response that holds the list, like data. Leave empty if the response is the list.
Next-page fieldpaging_nexttext
The field in each response that holds the next page's link or cursor, like links.next.
Page parameterpaging_paramtext
The URL parameter that asks for a page, like page or cursor.
Maximum pagespaging_max_pagesnumber
Stops here even if there are more pages.From 1 to 100. Default: 10.

Outputs

bodyobject
has_moretrue/false
Whether the page cap stopped it early.
headersobject
oktrue/false
pagesnumber
How many pages were fetched, when paging.
statusnumber
urltext
Example output
{
  "body": {},
  "has_more": true,
  "headers": {},
  "ok": true,
  "pages": 1,
  "status": 1,
  "url": "example_value"
}

On this page