Description
Turn your workflow into a real REST API with a STRUCTURED, consistent response envelope: placed after a Webhook trigger (respond-node mode), it builds the status/body/headers of the HTTP reply in standard REST shape.
action_api_response · action · HTTP & Webhook · Available · v1.0.0
Turn your workflow into a real REST API with a STRUCTURED, consistent response envelope: placed after a Webhook trigger (respond-node mode), it builds the status/body/headers of the HTTP reply in standard REST shape.
Fields shown in the editor when configuring the node. Generated directly from the NodeDefconfigFields.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
modeTipo di risposta | enumsuccesserror | yes | success | success = { ok:true, data } · error = { ok:false, error } con status mappato automaticamente. |
dataDati (payload) | expression | no | input | Il contenuto della risposta (oggetto/JSON o expression upstream). Vuoto = usa l'input del nodo. |
statusSuccessStatus di successo | enum200201202204 | no | 200 | 200 OK · 201 Created · 202 Accepted · 204 No Content (senza body). |
metaMeta (JSON, opzionale) | JSON object/array | no | — { "page": 1, "pageSize": 20, "total": 137 } | Metadati aggiunti come { ok, data, meta }. Tipico per paginazione/totali. |
errorCodeCodice errore | enumbad_requestunauthorizedforbiddennot_foundconflictvalidation_errorrate_limitedserver_error | no | bad_request | Mappa automaticamente sullo status HTTP (es. not_found→404, validation_error→422). |
errorMessageMessaggio errore | string | no | — Risorsa non trovata | Messaggio leggibile. Vuoto = derivato dal codice. |
errorDetailsDettagli errore (JSON, opzionale) | JSON object/array | no | — { "field": "email", "reason": "formato non valido" } | Dettagli strutturati (es. errori di validazione per campo). |
envelopeEnvelope { ok, data/error } | boolean | no | true | Avvolge la risposta nel formato standard. Disattiva per restituire i dati grezzi. |
corsAbilita CORS | boolean | no | — | Aggiunge gli header CORS — necessario se l'API è chiamata dal browser di una SPA. |
corsOriginCORS Origin | string | no | * | Origine consentita (* o un dominio specifico). |
corsMethodsCORS Metodi | string | no | GET,POST,PUT,DELETE,OPTIONS | — |
corsHeadersCORS Header consentiti | string | no | Content-Type,Authorization | — |
corsCredentialsCORS Credentials | boolean | no | — | Consente l'invio di cookie/credenziali (Access-Control-Allow-Credentials). |
headersHeader personalizzati (JSON) | JSON object/array | no | — { "Cache-Control": "no-store", "X-Api-Version": "1" } | Header extra. I valori con a-capo (CRLF) vengono scartati (anti-injection). |
Fields available to downstream nodes via $node.<alias>.json.<field>:
defaultJSON snippet of the node as it appears in the workflow. Values are derived fromdefaultValue and from required parameters.
{
"id": "node-action_api_response-1",
"defId": "action_api_response",
"label": "API: REST Response",
"config": {
"mode": "success",
"data": "input",
"statusSuccess": "200",
"errorCode": "bad_request",
"envelope": true,
"corsOrigin": "*",
"corsMethods": "GET,POST,PUT,DELETE,OPTIONS",
"corsHeaders": "Content-Type,Authorization"
}
}Available now on all FlowForge plans. Try it free without a credit card.
Start freeBrowse all nodes