This Cognigy extension provides workflow completion tracking capabilities for your Cognigy flows, allowing you to mark workflows as completed or failed while capturing session metrics.
-
Build the extension:
npm install npm run build
-
Upload the generated
workflow-completion-*.tar.gzfile to your Cognigy.AI instance via Manage > Extensions > Upload Extension
This node appears in the Cognigy node palette as "Send Status to CXone Copilot" (type sendCopilotStatus). It is a terminal node that marks workflow completion status and captures session metrics.
- Simple dropdown to mark workflow as "Success" or "Failure"
- Optional JSON data field for custom output data
- Captures session metrics (when available)
- Designed as a terminal node for end-of-flow placement
- Outputs structured data for analytics and reporting
- Silent execution with empty say() message
- Completion Status (
status): Dropdown selection between:Success(default): Marks the workflow as successfully completedFailure: Marks the workflow as failed or incomplete
- Additional Data (
data): Optional field to include custom data in the output (typically JSON)- Value is passed through as provided by the flow
- Only included in the output when non-empty data is provided
- The node does not validate or parse this field; ensure it contains valid JSON if required by downstream consumers
The node outputs data in the following structure:
{
"status": "Complete", // or "Failed" (internal values)
"metrics": {
// Session metrics when available:
// - sessionId: Unique session identifier
// - channel: The channel through which the conversation took place
// - language: The language of the session
// - completionTimestamp: ISO timestamp when the workflow completed
// Empty object {} if metrics are not accessible
},
"data": {
// Optional: Custom data when provided
// Only present if additional data was specified
// Contains whatever structure was supplied (typically JSON)
}
}- Place the Workflow Completion node at the end of your successful flow path
- Select "Success" from the dropdown
- Optionally add custom JSON data in the "Additional Data" field
- The node will execute
say("")(empty message) and output completion data
For error handling paths:
- Place another Workflow Completion node at the end of error flows
- Select "Failure" from the dropdown
- Optionally include error details in the "Additional Data" field as JSON
- Use the output data for failure tracking and analytics
// Success scenario with user details
{
"userId": "12345",
"completionTime": 1640995200000,
"path": "checkout_flow"
}
// Failure scenario with error details
{
"errorCode": "PAYMENT_FAILED",
"errorMessage": "Credit card declined",
"retryAttempts": 3
}- Analytics and Reporting: Track completion rates across different workflows
- Performance Monitoring: Measure session duration and interaction counts
- Quality Assurance: Identify failed workflow paths for improvement
- Business Intelligence: Export completion data for business metrics
- A/B Testing: Compare completion rates between different flow versions
This extension uses Jest for unit tests.
- Run all tests:
npm test - Run tests in watch mode:
npm run test:watch
Node not appearing in palette
- Ensure the extension was properly uploaded and enabled
- Check that the extension build completed without errors
Missing metrics data
- Some metrics may not be available in all Cognigy environments
- The metrics object will be empty
{}if session data is not accessible
Workflow not terminating
- Ensure the Workflow Completion node is connected as the final node
- Check that no other nodes follow the completion node
npm install
npm run transpile
npm run lint
npm run build # Includes transpile, lint, and zipsrc/
├── nodes/ # Node implementations (workflowCompletion)
├── test-utils/ # Test utilities and mocks
└── types/ # TypeScript type definitions
NiCE
NiCE