> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liberate.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# End node

# End Event Node

The **End Event Node** marks the completion of a workflow and defines what response is returned to the caller. Every workflow must have at least one End Event Node.

> [!NOTE]
>
> The End Event Node is where your workflow's output is finalized. For Voice AI integrations, this is how you send information back to the AI agent—like a claim number or confirmation message.

## Overview

Use an End Event Node to:

* Mark the successful completion of a workflow
* Return data to Voice AI for the agent to communicate to the caller
* Send response data back to API callers
* Define different endings for success and error paths
* Complete error handling branches

***

## Configuration

Click on an End Event Node to open its configuration panel.

### Basic Settings

| Setting | Description |
| - | - |
| **Title** | Descriptive name for the node |
| **Response Data** | Data to return when workflow completes |
| **Status** | Success or error status indicator |

### Response Configuration

Define what data is returned when the workflow reaches this End Node:

| Option | Description |
| - | - |
| **Return Full Context** | Returns the entire workflow context |
| **Return Specific Fields** | Returns only selected context fields |
| **Return Static Response** | Returns a predefined response object |
| **Return Mapped Response** | Returns a transformed response using JSONata |

***

## Multiple End Nodes

Workflows can have multiple End Event Nodes to handle different outcomes:

```
Start → Process → Decision
                      ├── Success Path → End Node (Success)
                      └── Error Path → End Node (Error)
```

### Common Patterns

**Success and Error Endings:**

```
Workflow with two End Nodes:
  - "Claim Created Successfully" (success path)
  - "Claim Creation Failed" (error path)
```

**Multiple Success Outcomes:**

```
Workflow with three End Nodes:
  - "Claim Approved" (auto-approved)
  - "Claim Pending Review" (needs adjuster)
  - "Claim Rejected" (validation failed)
```

***

## Returning Data to Voice AI

When Voice AI triggers a workflow, the End Node response is passed back to the AI agent. The agent can then communicate this information to the caller.

### Example: Return Claim Number

**Context at End Node:**

```json theme={null}
{
  "claimId": "CLM-98765",
  "claimStatus": "created",
  "estimatedProcessingDays": 3,
  "adjusterAssigned": "John Smith"
}
```

**Response Configuration (Return Specific Fields):**

```json theme={null}
{
  "success": true,
  "claimNumber": "$.claimId",
  "message": "Your claim has been submitted successfully."
}
```

**Voice AI receives:**

```json theme={null}
{
  "success": true,
  "claimNumber": "CLM-98765",
  "message": "Your claim has been submitted successfully."
}
```

**AI Agent says:**

> "Great news! Your claim has been submitted successfully. Your claim number is CLM-98765. Is there anything else I can help you with?"

***

### Example: Return Error Message

**Context at End Node (error path):**

```json theme={null}
{
  "validationError": true,
  "errorCode": "INVALID_POLICY",
  "errorMessage": "Policy number not found in system"
}
```

**Response Configuration:**

```json theme={null}
{
  "success": false,
  "error": "$.errorMessage",
  "action": "Please verify your policy number"
}
```

**Voice AI receives:**

```json theme={null}
{
  "success": false,
  "error": "Policy number not found in system",
  "action": "Please verify your policy number"
}
```

**AI Agent says:**

> "I was unable to find that policy number in our system. Could you please verify the number and try again?"

***

## Response Formats

### Return Full Context

Returns everything in the workflow context. Use when the caller needs all available data.

**Configuration:** Select "Return Full Context"

**Result:** Entire context object is returned, including system properties like tenantId and environment.

> [!WARNING]
>
> Returning full context may expose internal data. For production workflows, prefer returning specific fields.

### Return Specific Fields

Select which context fields to include in the response.

**Configuration:**

```json theme={null}
{
  "claimNumber": "$.claimId",
  "status": "$.claimStatus",
  "nextSteps": "$.processingInstructions"
}
```

**Result:** Only specified fields are returned.

### Return Static Response

Return a fixed response regardless of context. Useful for simple acknowledgments.

**Configuration:**

```json theme={null}
{
  "success": true,
  "message": "Request received and is being processed."
}
```

### Return Mapped Response

Use JSONata expressions to transform context data into the response format.

**Configuration:**

```jsonata theme={null}
{
  "success": true,
  "claim": {
    "id": $.claimId,
    "type": $.claimType,
    "submitted": $now()
  },
  "caller": {
    "name": $.callerFirstName & " " & $.callerLastName,
    "reference": $.correlationId
  }
}
```

***

## Insurance Examples

### FNOL Success Response

Return claim details after successful FNOL submission.

**End Node Title:** Claim Created Successfully

**Response:**

```json theme={null}
{
  "success": true,
  "claimNumber": "$.snapsheetResponse.claim_id",
  "claimStatus": "submitted",
  "message": "Your claim has been submitted.",
  "nextSteps": "An adjuster will contact you within 24-48 hours.",
  "referenceId": "$.correlationId"
}
```

***

### FNOL Error Response

Return error details when claim submission fails.

**End Node Title:** Claim Submission Failed

**Response:**

```json theme={null}
{
  "success": false,
  "errorType": "$.errorType",
  "message": "$.errorMessage",
  "action": "transferToAgent",
  "agentMessage": "Customer experienced an error during FNOL. Please assist with claim submission."
}
```

***

### Policy Lookup Response

Return policy information after successful lookup.

**End Node Title:** Policy Found

**Response:**

```json theme={null}
{
  "success": true,
  "policy": {
    "number": "$.policyData.policy_number",
    "status": "$.policyData.status",
    "holder": "$.policyData.insured_name",
    "effectiveDate": "$.policyData.effective_date",
    "expirationDate": "$.policyData.expiration_date"
  },
  "coverages": "$.policyData.coverages"
}
```

***

### Policy Not Found Response

Return helpful message when policy lookup fails.

**End Node Title:** Policy Not Found

**Response:**

```json theme={null}
{
  "success": false,
  "found": false,
  "message": "We could not locate a policy with that number.",
  "suggestions": [
    "Verify the policy number is correct",
    "Check if the policy may be under a different name",
    "The policy may have expired or been cancelled"
  ],
  "action": "requestPolicyNumber"
}
```

***

### Payment Confirmation Response

Return payment details after processing.

**End Node Title:** Payment Processed

**Response:**

```json theme={null}
{
  "success": true,
  "payment": {
    "confirmationNumber": "$.paymentResponse.confirmation_id",
    "amount": "$.paymentAmount",
    "method": "$.paymentMethod",
    "date": "$.paymentResponse.processed_date"
  },
  "message": "Your payment has been processed successfully.",
  "newBalance": "$.paymentResponse.remaining_balance"
}
```

***

### Warm Transfer Response

Return context for handoff to human agent.

**End Node Title:** Transfer to Agent

**Response:**

```json theme={null}
{
  "success": true,
  "action": "transferToAgent",
  "transferReason": "$.escalationReason",
  "agentContext": {
    "callerName": "$.callerFirstName & ' ' & $.callerLastName",
    "policyNumber": "$.policyNumber",
    "callSummary": "$.conversationSummary",
    "attemptedAction": "$.requestedAction",
    "relevantData": "$.collectedData"
  },
  "callerMessage": "I am going to connect you with a specialist who can help you further."
}
```

***

## Success vs Error End Nodes

### Naming Conventions

Use clear names to distinguish different endings:

| Path | Suggested Names |
| - | - |
| Success | Claim Created Successfully, Policy Found, Payment Processed |
| Error | Claim Submission Failed, Policy Not Found, Validation Error |
| Transfer | Transfer to Agent, Escalate to Supervisor |
| Pending | Claim Pending Review, Awaiting Documentation |

### Visual Organization

Use different colors or icons for End Nodes:

| Type | Suggested Color |
| - | - |
| Success | Green |
| Error | Red |
| Transfer | Yellow or Orange |
| Pending | Blue |

***

## Connecting to End Nodes

### From Task Nodes

Task Nodes have success and error paths that typically lead to different End Nodes:

```
Task Node (Create Claim)
    ├── Success → End Node: "Claim Created"
    └── Error → End Node: "Claim Failed"
```

### From Decision Tables

Decision Tables can route to different End Nodes based on outcomes:

```
Decision Table (Validate Claim)
    ├── Valid → Continue Processing → End Node: "Success"
    ├── Invalid → End Node: "Validation Failed"
    └── Needs Review → End Node: "Pending Review"
```

### From Code Nodes

Code Nodes can set flags that subsequent routing uses:

```
Code Node (Process Data)
    → Mapping Node (Check Result)
        ├── If success → End Node: "Success"
        └── If error → End Node: "Error"
```

***

## Best Practices

### Always Return Success Indicator

Include a clear success or failure indicator in every response:

```json theme={null}
{
  "success": true,
  "data": { ... }
}
```

or

```json theme={null}
{
  "success": false,
  "error": { ... }
}
```

### Provide Actionable Information

For Voice AI, include information the agent can communicate:

```json theme={null}
{
  "success": true,
  "claimNumber": "CLM-98765",
  "message": "Your claim has been submitted.",
  "nextSteps": "An adjuster will call you within 48 hours."
}
```

### Include Reference IDs

Always return identifiers that can be used for follow-up:

```json theme={null}
{
  "claimNumber": "CLM-98765",
  "referenceId": "$.correlationId",
  "transactionId": "$.instanceId"
}
```

### Handle All Paths

Ensure every possible workflow path leads to an End Node. Workflows that can reach a dead end will fail.

### Keep Responses Focused

Return only what the caller needs. Avoid exposing internal data:

```json theme={null}
// Good - focused response
{
  "success": true,
  "claimNumber": "CLM-98765"
}

// Bad - exposes internal details
{
  "success": true,
  "claimNumber": "CLM-98765",
  "internalSystemId": "SYS-123",
  "databaseRecordId": 98765,
  "processingNode": "server-west-2"
}
```

***

## Common Issues

### Workflow Has No End Node

**Symptom:** Workflow fails with no completion.

**Fix:** Add at least one End Event Node. Ensure all paths connect to an End Node.

### Response Data is Empty

**Symptom:** End Node returns empty or null response.

**Fix:** Check that response configuration references correct context paths. Verify data exists in context at the point of the End Node.

### Wrong End Node Reached

**Symptom:** Success End Node reached when error should have occurred.

**Fix:** Review routing logic. Check Decision Table rules or conditional branches to ensure proper path selection.

### Sensitive Data in Response

**Symptom:** Internal data exposed in API response.

**Fix:** Use "Return Specific Fields" instead of "Return Full Context". Only include necessary fields.

***

## End Node Checklist

Before deploying your workflow, verify each End Node:

* Has a clear, descriptive title
* Returns appropriate success or error status
* Includes all necessary data for the caller
* Does not expose sensitive internal data
* Is reachable from the workflow logic
* Has been tested with expected inputs

***

## Next Steps

> [card] [Start Event Node](https://docs.liberate.ai/workflows/nodes/start-node.md)
>
> Configure workflow entry points

> [card] [Task Node](https://docs.liberate.ai/workflows/nodes/task-node.md)
>
> Connect to external systems

> [card] [Voice AI Workflows](https://docs.liberate.ai/workflows/voice-ai-workflows.md)
>
> See complete workflow examples

> [card] [Release Management](https://docs.liberate.ai/workflows/release-management.md)
>
> Deploy your workflows


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.