Response Block YAML Schema
YAML-Konfigurationsreferenz für Response-Blöcke
Schema-Definition
type: object
required:
- type
- name
properties:
type:
type: string
enum: [response]
description: Block type identifier
name:
type: string
description: Display name for this response block
inputs:
type: object
properties:
dataMode:
type: string
enum: [structured, json]
description: Mode for defining response data structure
default: structured
builderData:
type: object
description: Structured response data (when dataMode is 'structured')
data:
type: object
description: JSON response data (when dataMode is 'json')
status:
type: number
description: HTTP status code
default: 200
minimum: 100
maximum: 599
headers:
type: array
description: Response headers as table entries
items:
type: object
properties:
id:
type: string
description: Unique identifier for the header entry
key:
type: string
description: Header name
value:
type: string
description: Header value
cells:
type: object
description: Cell display values for the table interface
properties:
Key:
type: string
description: Display value for the key column
Value:
type: string
description: Display value for the value column
Verbindungskonfiguration
Response-Blöcke sind Endblöcke (keine ausgehenden Verbindungen) und definieren die endgültige Ausgabe:
# No connections object needed - Response blocks are always terminal
Beispiele
Einfache Antwort
simple-response:
type: response
name: "Simple Response"
inputs:
data:
message: "Hello World"
timestamp: <function.timestamp>
status: 200
Erfolgreiche Antwort
success-response:
type: response
name: "Success Response"
inputs:
data:
success: true
user:
id: <agent.user_id>
name: <agent.user_name>
email: <agent.user_email>
created_at: <function.timestamp>
status: 201
headers:
- key: "Location"
value: "/api/users/<agent.user_id>"
- key: "X-Created-By"
value: "workflow-engine"
Antwort mit vollständigem Tabellenkopfformat
Wenn Header über die UI-Tabellenschnittstelle erstellt werden, enthält das YAML zusätzliche Metadaten:
api-response:
type: response
name: "API Response"
inputs:
data:
message: "Request processed successfully"
id: <agent.request_id>
status: 200
headers:
- id: header-1-uuid-here
key: "Content-Type"
value: "application/json"
cells:
Key: "Content-Type"
Value: "application/json"
- id: header-2-uuid-here
key: "Cache-Control"
value: "no-cache"
cells:
Key: "Cache-Control"
Value: "no-cache"
- id: header-3-uuid-here
key: "X-API-Version"
value: "2.1"
cells:
Key: "X-API-Version"
Value: "2.1"
Fehlerantwort
error-response:
type: response
name: "Error Response"
inputs:
data:
error: true
message: <agent.error_message>
code: "VALIDATION_FAILED"
details: <function.validation_errors>
status: 400
headers:
- key: "X-Error-Code"
value: "VALIDATION_FAILED"
Paginierte Antwort
paginated-response:
type: response
name: "Paginated Response"
inputs:
data:
data: <agent.results>
pagination:
page: <start.page>
per_page: <start.per_page>
total: <function.total_count>
total_pages: <function.total_pages>
status: 200
headers:
- key: "X-Total-Count"
value: <function.total_count>
- key: "Cache-Control"
value: "public, max-age=300"
- key: "Content-Type"
value: "application/json"
Tabellenparameterformate
Der Response-Block unterstützt zwei Formate für Header:
Vereinfachtes Format (manuelles YAML)
Beim manuellen Schreiben von YAML können Sie das vereinfachte Format verwenden:
headers:
- key: "Content-Type"
value: "application/json"
- key: "Cache-Control"
value: "no-cache"
Vollständiges Tabellenformat (UI-generiert)
Wenn Header über die UI-Tabellenschnittstelle erstellt werden, enthält das YAML zusätzliche Metadaten:
headers:
- id: unique-identifier-here
key: "Content-Type"
value: "application/json"
cells:
Key: "Content-Type"
Value: "application/json"
Wesentliche Unterschiede:
id
: Eindeutiger Identifikator zur Verfolgung der Tabellenzeilecells
: Anzeigewerte, die von der UI-Tabellenschnittstelle verwendet werden- Beide Formate sind für die Workflow-Ausführung funktional gleichwertig
- Das vollständige Format bewahrt den UI-Status beim Importieren/Exportieren von Workflows
Wichtig: Setzen Sie Header-Namen und Werte, die Sonderzeichen enthalten, immer in Anführungszeichen:
headers:
- id: content-type-uuid
cells:
Key: "Content-Type"
Value: "application/json"
- id: cache-control-uuid
cells:
Key: "Cache-Control"
Value: "no-cache"