Skip to content

HTTP and Web Hooks ​

Cloud Flow Blocks reference.

Blocks ​

HTTP Content Type ​

Block name: http_content_type

Provides a predefined HTTP Content-Type value for web hook response blocks.

Inputs ​

InputTypeDescriptionAccepts
content typechoiceThe predefined Content-Type value to use.

Output ​

This block produces an output value of type String.

Behavior ​

Generates the selected predefined HTTP Content-Type string.

HTTP Data ​

Block name: httpdata

Provides the response data returned by a Cloud Flow web hook call, HTTP POST request, or HTTP GET request when used inside a success callback.

Output ​

This block produces an output value of type Any.

Behavior ​

Returns the current HTTP response object exposed by Cloud Flow and HTTP success callbacks when available.

HTTP Error ​

Block name: httperr

Provides the error information returned by a Cloud Flow web hook call, HTTP POST request, or HTTP GET request when used inside a failure callback.

Output ​

This block produces an output value of type Any.

Behavior ​

Returns the current HTTP error object exposed by Cloud Flow and HTTP failure callbacks when available.

HTTP GET ​

Block name: httpget

Sends an HTTP GET request to the specified URL, then runs the nested success or failure statements when the request finishes.

Inputs ​

InputTypeDescriptionAccepts
URLstringThe URL to request. This is typically provided by a text block.text
on successstatementsThe statements to run when the request succeeds. Inside this block, httpdata provides the returned response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on failurestatementsThe statements to run when the request fails. Inside this block, httperr provides the returned error information. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that sends an HTTP GET request through the ioLoop system runtime. The success blocks are emitted inside function(tvwaHttpData) { ... }, and the failure blocks are emitted inside function(tvwaHttpErr) { ... }, so customcode and customcodeexpr blocks inside those callbacks can access the matching in-scope variable directly. JSON responses are parsed when the response content type is standard JSON; otherwise the raw response text is passed through.

Calls: $io.system.httpGet

HTTP POST ​

Block name: httppost

Sends an HTTP POST request with the provided data to the specified URL, then runs the nested success or failure statements when the request finishes.

Inputs ​

InputTypeDescriptionAccepts
URLstringThe URL to send the request to. This is typically provided by a text block.text
dataobjectThe request data to submit with the POST request. This is typically provided by a define_object block so form fields are named explicitly.define_object
on successstatementsThe statements to run when the request succeeds. Inside this block, httpdata provides the returned response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on failurestatementsThe statements to run when the request fails. Inside this block, httperr provides the returned error information. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that sends an HTTP POST request through the ioLoop system runtime. The success blocks are emitted inside function(tvwaHttpData) { ... }, and the failure blocks are emitted inside function(tvwaHttpErr) { ... }, so customcode and customcodeexpr blocks inside those callbacks can access the matching in-scope variable directly. JSON responses are parsed when the response content type is standard JSON; otherwise the raw response text is passed through.

Calls: $io.system.httpPost

HTTP Status ​

Block name: http_status

Provides a predefined HTTP status code value for web hook response blocks.

Inputs ​

InputTypeDescriptionAccepts
statuschoiceThe predefined HTTP status code to use.

Output ​

This block produces an output value of type Number.

Behavior ​

Generates the selected predefined HTTP status code value.

Request Data ​

Block name: webhook_request_data

Gets the request body data available in the current web hook execution.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates server-side code that reads the current web hook request body from the web hook context object when one is available.

Calls: $io.system.getWebHookPostData

Request Headers ​

Block name: webhook_request_headers

Gets the request headers for the current web hook request.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates server-side code that reads the current web hook request headers from the web hook context object when one is available.

Calls: $io.system.getWebHookRequestHeaders

Request IP Address ​

Block name: webhook_request_ip

Gets the client IP address for the current web hook request.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates server-side code that reads the client IP address from the current web hook context when one is available.

Calls: $io.system.getWebHookClientIpAddress

Request Params ​

Block name: webhook_request_params

Gets the query string parameters available in the current web hook execution.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates server-side code that reads the current web hook query parameters from the web hook context object when one is available.

Calls: $io.system.getWebHookQueryParameters

Response: Send Redirect ​

Block name: webhook_response_redirect

Sends a redirect response for the current web hook using the selected status code and target URL or path.

Inputs ​

InputTypeDescriptionAccepts
statusnumberThe HTTP status code to use for the redirect response. This is typically provided by an http_status block.http_status
URL/PathstringThe redirect target URL or path. This is typically provided by a text block.text

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that sends a redirect response through the current web hook context. If no status is connected, the generated code falls back to 200.

Calls: $io.system.sendWebHookRedirectResponse

Response: Send with Data ​

Block name: webhook_response_data

Sets the response body data for the current web hook without exiting immediately.

Inputs ​

InputTypeDescriptionAccepts
dataobjectThe response body to send. This is often provided by a define_object block for JSON responses, or by a text block for plain text or HTML responses.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that stores response data on the current web hook context and keeps execution running so later blocks can still set headers, content type, or exit explicitly. It calls the $io.system.setWebHookResponseData method with the noExit parameter set to true.

Calls: $io.system.setWebHookResponseData

Response: Set value of Header ​

Block name: webhook_response_header

Sets a response header on the current web hook response.

Inputs ​

InputTypeDescriptionAccepts
headerstringThe response header name to set. This is typically provided by a text block.text
valuestringThe value to assign to the response header. This is typically provided by a text block.text

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that sets a response header on the current web hook context.

Calls: $io.system.setWebHookResponseHeader

Set Response Content-Type ​

Block name: webhook_response_content_type

Sets the response Content-Type header for the current web hook response.

Inputs ​

InputTypeDescriptionAccepts
content typestringThe Content-Type value to use for the response. This is typically provided by an http_content_type block.http_content_type

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that updates the response Content-Type on the current web hook context.

Calls: $io.system.setWebHookResponseContentType

Set Response Status ​

Block name: webhook_response_status

Sets the HTTP status code for the current web hook response.

Inputs ​

InputTypeDescriptionAccepts
statusnumberThe HTTP status code to use for the response. This is typically provided by an http_status block.http_status

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that updates the response status code on the current web hook context. If no value is connected, the generated code falls back to 200.

Calls: $io.system.setWebHookResponseStatusCode

Webhook: Exit (Success) ​

Block name: webhook_return_success

Finishes the current web hook successfully and stops further execution of the current flow.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that exits the current web hook with a success result and immediately returns from the generated flow.

Calls: $io.system.exitWebHook

Webhook: Exit with error ​

Block name: webhook_return_fail

Finishes the current web hook with an error and stops further execution of the current flow.

Inputs ​

InputTypeDescriptionAccepts
errorstringThe error message to return for the failed web hook. This is typically provided by a text block.text

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that exits the current web hook with a failure result, passes through the provided error message, and immediately returns from the generated flow.

Calls: $io.system.exitWebHook