|
| 1 | +--- |
| 2 | +title: Collection Flow Observability |
| 3 | +description: Understanding and monitoring the state of your collection flow |
| 4 | +--- |
| 5 | + |
| 6 | +import CodeBlock from '../../../../components/CodeBlock/CodeBlock.astro'; |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +The Collection Flow provides comprehensive observability into its internal state through the workflow context. This allows you to monitor and understand the current state of the collection flow, its configuration, and progress in real-time. |
| 11 | + |
| 12 | +## Workflow Context Structure |
| 13 | + |
| 14 | +The workflow context contains several key components that provide insights into the collection flow: |
| 15 | + |
| 16 | +### Configuration (config) |
| 17 | + |
| 18 | +The configuration section defines the basic setup of your collection flow: |
| 19 | + |
| 20 | +<CodeBlock lang="json" code={`{ |
| 21 | + "config": { |
| 22 | + "apiUrl": "https://api.example.com", |
| 23 | + "steps": [ |
| 24 | + { |
| 25 | + "stateName": "personal_info", |
| 26 | + "orderNumber": 1 |
| 27 | + }, |
| 28 | + { |
| 29 | + "stateName": "company_details", |
| 30 | + "orderNumber": 2 |
| 31 | + } |
| 32 | + ] |
| 33 | + } |
| 34 | +}`}/> |
| 35 | + |
| 36 | +### State Management |
| 37 | + |
| 38 | +The state section tracks the current progress and status of the collection flow: |
| 39 | + |
| 40 | +<CodeBlock lang="json" code={`{ |
| 41 | + "state": { |
| 42 | + "currentStep": "company_details", |
| 43 | + "status": "inprogress", |
| 44 | + "progressBreakdown": { |
| 45 | + "personal_info": true, |
| 46 | + "company_details": false |
| 47 | + } |
| 48 | + } |
| 49 | +}`}/> |
| 50 | + |
| 51 | +#### Status Values |
| 52 | + |
| 53 | +The collection flow can have the following status values: |
| 54 | + |
| 55 | +- `pending`: Initial state, awaiting user data entry |
| 56 | +- `inprogress`: Active user engagement with form submission ongoing |
| 57 | +- `completed`: All steps finished, awaiting plugin processing and review |
| 58 | +- `approved`: Application approved by Backoffice |
| 59 | +- `revision`: Returned to client for corrections |
| 60 | +- `rejected`: Application rejected by Backoffice |
| 61 | +- `failed`: Plugin execution failure |
| 62 | + |
| 63 | +### Additional Information |
| 64 | + |
| 65 | +The context can include supplementary data used by plugins: |
| 66 | + |
| 67 | +<CodeBlock lang="json" code={`{ |
| 68 | + "additionalInformation": { |
| 69 | + "customField": "value", |
| 70 | + "pluginSpecificData": { |
| 71 | + // Plugin-specific information |
| 72 | + } |
| 73 | + } |
| 74 | +}`}/> |
| 75 | + |
| 76 | +## Monitoring and Debugging |
| 77 | + |
| 78 | +You can inspect the workflow context to: |
| 79 | + |
| 80 | +1. Track progress through the collection flow |
| 81 | +2. Debug issues with form submissions |
| 82 | +3. Understand the current state of plugin processing |
| 83 | +4. Verify configuration settings |
| 84 | +5. Monitor user progression through steps |
| 85 | + |
| 86 | +To access the workflow context, you can use the workflow runtime API or inspect it through the Backoffice interface. |
| 87 | + |
| 88 | +## Real-time Updates |
| 89 | + |
| 90 | +The context maintains bidirectional updates, meaning changes can occur from: |
| 91 | + |
| 92 | +- Frontend user interactions |
| 93 | +- Backend plugin processing |
| 94 | +- Administrative actions in the Backoffice |
| 95 | +- System automated processes |
| 96 | + |
| 97 | +This ensures you always have an accurate view of the collection flow's current state. |
0 commit comments