HTTP
The HTTP Node exposes inbound HTTP Workflow endpoints and writes responses from the same trigger context.
Revision History
0.0.0.3 - Initial release.
0.0.0.12 - Node name correction.
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.
Setup Notes
Generate an API key and provide it to the HTTP caller so they can authorize requests to the endpoint.
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 should be handled by another Node later in the Workflow.
This is a trigger method. It must be the first step in a Workflow, and a Workflow can only contain one trigger method.
| 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.
This is a trigger method. It must be the first step in a Workflow, and a Workflow can only contain one trigger method.
| 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.
This is a trigger method. It must be the first step in a Workflow, and a Workflow can only contain one trigger method.
| 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. |
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. |
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. |
Body |
Array | The JSON array response body. |
Usage Notes
- Choose the receive/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.
- The Node returns
Uri,Headers,Parameters, andBodyfrom receive methods.Parameterscontains route and query values resolved fromUriTemplate. HttpReceiveJsonObjectthrows an error when the request body is not valid JSON object content.HttpReceiveJsonArraythrows 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.