HTTP
The HTTP Node exposes inbound HTTP Workflow endpoints and writes responses from the same trigger context for webhooks and lightweight APIs.
Revision History
0.0.0.3 - Initial release.
0.0.0.12 - Corrected the Node name.
0.0.0.14 - Added JSON object and JSON array receive and respond methods.
0.0.0.21 - Added example templates and renamed raw receive and respond methods to stream variants.
0.0.0.23 - Improved HTTP body handling and streaming response behavior.
1.0.0.0 - Improved method templates and HTTP request and response handling.
1.0.0.1 - Updated the Node icon.
1.0.0.2 - Propagated cancellation through asynchronous operations.
1.0.0.3 - Added guidance for CORS in HTTP response headers.
Setup Notes
Generate an API key and provide it to the HTTP caller so they can authorize requests to the endpoint.
An HTTP receive method must be the first Step in the Workflow, and a Workflow can only contain one trigger method.
Methods
The HTTP Node exposes trigger methods that receive inbound requests and response methods that write the HTTP response for the active trigger.
HttpReceiveStream
Waits for a route to be triggered from an HTTP call and returns the request body as a stream. Use this method when the caller can send raw content or content that another Node should handle later in the Workflow.
| Parameter | Type | Description |
|---|---|---|
Method |
String | The HTTP method for the route. |
UriTemplate |
String | The request path and query for the route. |
| Return | Type | Description |
|---|---|---|
Uri |
String | The full request URI. |
Headers |
Object | The request headers. |
Parameters |
Object | The route and query parameters. |
Body |
Stream | The request body stream. |
HttpReceiveJsonObject
Waits for a route to be triggered from an HTTP call and parses the request body as a JSON object. Use this method when the caller sends one JSON object.
| Parameter | Type | Description |
|---|---|---|
Method |
String | The HTTP method for the route. |
UriTemplate |
String | The request path and query for the route. |
| Return | Type | Description |
|---|---|---|
Uri |
String | The full request URI. |
Headers |
Object | The request headers. |
Parameters |
Object | The route and query parameters. |
Body |
Object | The request body parsed as a JSON object. |
HttpReceiveJsonArray
Waits for a route to be triggered from an HTTP call and parses the request body as a JSON array. Use this method when the caller sends an array of JSON items.
| Parameter | Type | Description |
|---|---|---|
Method |
String | The HTTP method for the route. |
UriTemplate |
String | The request path and query for the route. |
| Return | Type | Description |
|---|---|---|
Uri |
String | The full request URI. |
Headers |
Object | The request headers. |
Parameters |
Object | The route and query parameters. |
Body |
Array | The request body parsed as a JSON array. |
HttpRespondStream
Writes an HTTP response for the active trigger. Use this method when the response body is a stream or raw content.
| Parameter | Type | Description |
|---|---|---|
StatusCode |
Integer | The HTTP status code to return. Defaults to 200. |
Headers |
Object | Headers to include in the HTTP response. The platform manages CORS through the Environment's Allowed Origins setting for cross-origin requests. Do not add Access-Control-* response headers. |
Body |
Stream | The response body. |
HttpRespondJsonObject
Writes a JSON object HTTP response for the active trigger. When Body is provided and no Content-Type header is supplied, the Node sets it to application/json; charset=utf-8.
| Parameter | Type | Description |
|---|---|---|
StatusCode |
Integer | The HTTP status code to return. Defaults to 200. |
Headers |
Object | Headers to include in the HTTP response. The platform manages CORS through the Environment's Allowed Origins setting for cross-origin requests. Do not add Access-Control-* response headers. |
Body |
Object | The JSON object response body. |
HttpRespondJsonArray
Streams a JSON array HTTP response for the active trigger without buffering the complete array. When Body is provided and no Content-Type header is supplied, the Node sets it to application/json; charset=utf-8.
| Parameter | Type | Description |
|---|---|---|
StatusCode |
Integer | The HTTP status code to return. Defaults to 200. |
Headers |
Object | Headers to include in the HTTP response. The platform manages CORS through the Environment's Allowed Origins setting for cross-origin requests. Do not add Access-Control-* response headers. |
Body |
Array | The JSON array response body. |
Usage Notes
- Choose the receive and respond pair that matches the body shape you want to work with: stream, JSON object, or JSON array.
- The receive method starts the Workflow from the inbound HTTP request. The respond method sends the HTTP response back to the original caller.
- Receive methods return
Uri,Headers,Parameters, andBody.Parameterscontains route and query values resolved fromUriTemplate. HttpReceiveJsonObjectraises an error when the request body is not valid JSON object content.HttpReceiveJsonArrayraises an error when the request body is not valid JSON array content.- Each receive and respond method provides a method-specific example template with sample route, header, and body Properties.
- Saving a valid Workflow with a receive method creates the endpoint described by
UriTemplateon the environment in your Flowgear site settings.
Examples
Example Template
The receive method templates use GET with the following UriTemplate:
/example/{pathVariable}?filter={queryVariable}
The templates include sample Headers, Parameters, and Body Properties for the selected stream, JSON object, or JSON array method. Respond method templates use a StatusCode of 200, a Content-Type header of application/json; charset=utf-8, and a Body that matches the selected method.
Endpoint URL
If the environment is company-test.flowgear.net and UriTemplate is /custom/account/create, the exposed endpoint is:
https://company-test.flowgear.net/custom/account/create
Only callers with the generated API key can access the endpoint.