HTTP Node
Overview
An HTTP node sends GET or POST requests from an offline workflow. A response status code beginning with 2, such as 200 or 201, indicates success; other status codes cause failure. For long-running asynchronous APIs, enable callback polling to query the task status.
Node Configuration
Node Name and Description
Enter the node name and, optionally, a description to identify the node on the canvas and in run records.

Request URL
Select GET or POST and enter the API URL. The default method is GET.
Request Parameters

| Configuration Item | Description |
|---|---|
| Headers | Key/value pairs that tell the server what type of resource is required. |
| Authorization | Currently supports two authentication methods: API Key and Token. API Key identifies the source of a request to a web service or similar service. Token represents a user role for a specified period and grants permission to call the interface. |
| Query Params | The fields and conditions to be retrieved. Supports Global Parameters, Time Macro Parameters, and Workflow Parameter.![]() |
| Body | JSON only. Encapsulates the request parameters of a POST request and supports Global Parameters, Time Macro Parameters, and Workflow Parameter.![]() |
- Validation rule: The node succeeds when the configured condition is met. If the response status code does not start with
2, such as200or201, the task ends with an error.
Polling Callback Interface
Enable Polling Callback Interface to query the status of a long-running request.
| Configuration Item | Description |
|---|---|
| Polling Interval (Seconds) | Poll once every X seconds. |
| Callback URL | Supports GET and POST, with GET as the default. This field specifies the callback URL. |
| Headers | Key/value pairs that tell the server what type of resource is required. |
| Authorization | Currently supports API Key and Token. API Key identifies the source of a request. Token represents a user role for a specified period and grants permission to call the interface. |
| Query Params | The fields and conditions to be retrieved. Supports Global Parameters, Time Macro Parameters, and Workflow Parameter. |
| Body | JSON only. Encapsulates the request parameters of a POST request and supports Global Parameters, Time Macro Parameters, and Workflow Parameter. |

Callback Notes
- The main request must return parameters in the following format:
{
"taskId": "xxxxxx"
}
-
The platform automatically extracts
taskIdand appends it to the callback URL.
For example, the URL is automatically appended as
http://127.0.0.1:8004/status/xxxxxx. -
Validate the callback result:
- The return format must be
{ "status": "xxxxxx", ... }. - If the response status code does not start with
2, such as200or201, the task ends with an error directly. - If
statusisPROCESSING, polling continues. Otherwise, polling ends.SUCCESSmeans success; any other value means failure. - Be careful to avoid infinite loops in the service.
- The return format must be
Runtime Options
- Run status
- Do Not Execute: When the workflow reaches this node, execution is skipped directly. This is commonly used for temporary data troubleshooting and partial task execution control.
- Normal: The node runs according to the existing scheduling strategy. This is the default run status.
- Retry on failure
- Retry count: The number of automatic retries after node failure. The default is
1. - Retry interval: The interval before each retry is triggered. The default is
5minutes.
- Retry count: The number of automatic retries after node failure. The default is
- Timeout limit
- Timeout duration: The timeout limit for a single node. The node fails automatically if the limit is exceeded.

Example: Calling a Python Service Through HTTP
Python API Service Dependencies
flask
request
jsonify
cachetools
Python Service Script
# -*- coding: utf-8 -*-
from flask import Flask, request, jsonify
from concurrent.futures import ThreadPoolExecutor
from cachetools import TTLCache
import uuid
import io
import contextlib
app = Flask(__name__)
# Thread pool (up to 10 concurrent tasks)
executor = ThreadPoolExecutor(max_workers=10)
# Convert 2 days to seconds
two_days_in_seconds = 2 * 24 * 60 * 60
# Create a cache object with a 2-day TTL for each entry
task_cache = TTLCache(maxsize=100, ttl=two_days_in_seconds)
def run_python_code(code, taskId):
"""Execute Python code and store the result."""
try:
result = execute_code(code)
task_cache[taskId] = {"taskId": taskId, "status": "SUCCESS", "log": result}
except Exception as e:
task_cache[taskId] = {"taskId": taskId, "status": "FAILED", "error": str(e)}
@app.route("/run_code", methods=["POST"])
def run_code():
"""Submit a code task and run it asynchronously."""
data = request.get_json()
code = data.get("code", "").strip()
if not code:
return jsonify({"error": "No code provided"}), 400
# Generate a unique taskId
taskId = str(uuid.uuid4())
# Record task start
task_cache[taskId] = {"taskId": taskId, "status": "PROCESSING"}
# Submit the task to the thread pool
executor.submit(run_python_code, code, taskId)
return jsonify({"taskId": taskId, "status": "PROCESSING"})
@app.route("/status/<taskId>", methods=["GET"])
def check_status(taskId):
"""Query task status."""
if taskId not in task_cache:
return jsonify({"taskId": taskId, "status": "FAILED", "error": "Task not found"}), 404
task_info = task_cache[taskId]
if task_info["status"] == "FAILED":
return jsonify({"taskId": taskId, "status": "FAILED", "error": task_info["error"]}), 500
return jsonify(task_info)
# Function that executes the code
def execute_code(code):
# Use StringIO to capture print output
output_buffer = io.StringIO()
try:
# Redirect standard output to output_buffer
with contextlib.redirect_stdout(output_buffer):
exec(code)
# Get the captured output
output = output_buffer.getvalue()
return output.strip() # Return the captured output
except Exception as e:
# Return the error message if code execution fails
return f"Code execution failed: {str(e)}"
finally:
# Close the StringIO buffer
output_buffer.close()
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8004, debug=True) # Listen on all addresses, port 8004
Configure the HTTP Node
- Set the request method to POST and configure the parameters in Body.

- Enable Polling Callback Interface and configure the callback API.


