Kafka Response (Enhanced)
AI-generatedSummary
Commit a message offset to mark it as successfully processed or mark the message as failed for retrying within a Kafka-triggered workflow.
Inputs
- Action (required) — Choose to either commit the message offset ('commit') or mark the message as failed ('fail').
- Error Message — Provide an error message to log when marking the message as failed (visible only when 'fail' action is selected).
Output shape
A list of items each containing the original message JSON extended with a _kafkaResponse object indicating success or failure, the action taken, timestamps, and message metadata (topic, partition, offset, retry count, etc.).
Each output item corresponds to an input item and includes metadata from Kafka context such as messageId, topic, partition, offset, retryCount, and sessionId. The commit action requires the input item to contain valid Kafka context (from Kafka Trigger). Errors during processing are captured per item and flagged with an 'error' action in the output.
Examples
Example 1: Committing message offsets after successful processing
Set 'Action' to 'Commit Offset'. The node commits the offset by incrementing the offset by one and notifying Kafka, confirming the message was processed successfully.
Example 2: Marking a message as failed to enable retry
Set 'Action' to 'Mark Failed' and optionally provide an 'Error Message'. This flags the message for retry without committing the offset.