We’ve added flexibility to how forms handle submission workflows, allowing administrators and developers to choose between two modes: Synchronous (Sync) and Asynchronous (Async). By default, all forms are now set to Asynchronous Mode. In this mode, when a form is submitted, it triggers an associated workflow in the background, and the form submission process completes without waiting for the workflow to finish. This results in a quicker user experience, as users are given confirmation of their submission immediately, without delay.
In contrast, Synchronous Mode forces the form to wait for the workflow to complete before displaying the form confirmation message to the user. This mode is particularly useful when it’s critical for users to receive immediate feedback on the outcome of their submission, such as in cases where workflow success or failure directly impacts the next steps in the user’s interaction.
Key Changes:
- Default Mode: Forms are set to asynchronous by default.
- Synchronous Mode: Forms can be switched to synchronous, causing the confirmation to be delayed until the workflow finishes executing.
- Error Handling:
- In Asynchronous Mode, any workflow errors will not be shown to the user immediately. The user will only see the form submission confirmation, regardless of the workflow’s result.
- In Synchronous Mode, workflow errors are displayed immediately as part of the form submission confirmation, providing real-time feedback to the user about any issues with the workflow.
Use Case Examples:
- Asynchronous Mode (Default):
- Scenario: A user submits a form to request access to a new feature or resource. The form triggers a backend workflow to process the request (e.g., checking eligibility or provisioning access). Since the workflow may take some time to complete, the user immediately receives a confirmation message stating their request is being processed.
- Benefit: The user doesn’t experience delays in form submission and can continue with other tasks while the workflow completes in the background. Any issues with the workflow (e.g., eligibility failure or resource unavailability) are handled without interrupting the user experience.
- Synchronous Mode:
- Scenario: A user submits a support ticket form that triggers a complex approval workflow. If the workflow fails (e.g., due to incorrect data or approval rejection), the user needs to know right away to adjust or resubmit their form.
- Benefit: The user waits for the workflow to complete and receives a confirmation message that reflects the result of the workflow. If the workflow encounters an error, such as an invalid submission or failure in processing, the error message is presented immediately, allowing the user to resolve the issue right away.
Impact:
- Performance: Synchronous mode may introduce delays, especially for workflows with complex or lengthy processing tasks.
- User Experience: Asynchronous mode improves user experience by reducing wait times, but may hide workflow errors from the user unless specifically configured to display notifications.
This feature provides greater flexibility in form handling, allowing developers and administrators to select the most appropriate mode based on user needs and workflow complexity.