Anvil Workflows already support complex, variable business processes, from new employee onboarding paperwork to insurance quoting and everything in between. Within a Workflow, you can build logic to customize the questions in a Webform, the output onto a PDF, and even the documents to be completed. This means that a single Workflow can support many “branches” of a business process without human intervention.
Workflows can become unwieldy when the logic gets extremely complicated or you want to retain a higher degree of human discretion and control. In those cases, it’s better to manage the logic of which documents to include in a Workflow from your own system rather than build it into a single Anvil Workflow. What you don’t want to do is ask your customers to answer the same questions or sign multiple times. You also don’t want (and really can’t have) your team building custom document sets and associated webforms for each iteration of the Workflow you want to present.
What’s needed is a solution for your team or system to create a custom Workflow with a single signature packet from a set of other Workflows, without having to rebuild any of the logic or mapping that makes them easy for your customers to complete. That’s exactly what we offer with Dynamic Workflows, which allow you to “merge” any combination of Workflows in your Anvil organization with a GraphQL mutation. Read the docs here.
To dig a little deeper into what it means to “merge” Workflows, consider the following real life example. One of Anvil’s customers provides staffing solutions for companies all over the world in a variety of industries. The company is responsible for ensuring each employee has completed an onboarding flow that includes government documents, identity verification, payroll forms, and job specific training and disclosures. The specific forms and steps involved in each employee’s onboarding flow are dependent on the country, region, employer, and role. Furthermore, the webform questions the employee sees must be in their primary language.
The HR tech company has an admin team responsible for working with candidates to complete their onboarding within the agency’s mobile application. An admin will choose the language, document groups (e.g. UK government forms), and additional documents specific to that candidate's role from within their application’s dashboard. The application’s system then calls Anvil with the
mergeWeld mutation, which creates a merged Workflow with the previously selected set of individual Workflows – all in the correct language and specified order. The newly created Dynamic Workflow will automatically deduplicate any repeated fields (based on field aliases) and signers in the merge operation. The company then presents the Dynamic Workflow in an iframe in their mobile app for the applicant to provide their information and sign all at once.
If you are an Anvil user and are thinking about using Dynamic Workflows, here are some other details you should know about how they work.
All PDFs across all the Workflows will be included in the merged Workflow. Logic on PDFs and PDF fields will be retained in the new merged Workflow.
Signers will be merged based on their ordering.
- The first signer of the merged Workflow will sign all fields attached to them across all Workflows.
- Signer name and email address will be taken from the first Workflow in the list of merged Workflows
When Workflows (welds) are merged, pages from the first (entry) webform in all Workflows will be appended together. Pages will be merged in the order specified, resulting in one webform with pages from each entry webform.
If a Workflow contains more than one webform, the second, third, etc webforms will be added to the Workflow verbatim.
Fields on webforms can be deduplicated by using the same field alias value on fields across Workflows.
- The first field found with a field alias will be used as the source of truth.
- Subsequent fields with an already-used field alias will be removed from the webform page.
- All logic based on a subsequent field alias will be modified to work based on the first field found.
Since fields with an already-found alias will be removed, it is possible all fields on a page are removed. When all fields on a page are removed, the page itself will be removed.
Dynamic Workflows are a feature of our Enterprise Plan. To learn more about how it works, email email@example.com.