Product teams should be thinking differently about documents.Read blog post.
Anvil Logo
Product News

Build hyper-customized document workflows with Dynamic Workflows

Author headshot
By Sophie Benjamin

The mergeWeld graphQL mutation allows you to fully control the creation of new Workflows from within your product. Combine a set of existing Workflows in any order into a single Workflow and resulting signature packet.

Back to all articles
Post hero image

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.

Dynamic Workflows enable another level of customization for product teams

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.

How Dynamic Workflows merge your existing Workflows

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.

Merging PDFs

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.

Merging Signers

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

Merging Webforms

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.

De-duplicating Webform fields

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.

Learn more about building with Anvil

Dynamic Workflows are a feature of our Enterprise Plan. To learn more about how it works, email

Sign up for a live demo

Request a 30-minute live demo today and we'll get in touch shortly. During the meeting our Sales team will help you find the right solution, including:
  • Simplifying data gathering
  • Streamlining document preparation
  • Requesting e-signatures
  • Building and scaling your business
Want to try Anvil first?Sign up for free
Want to try Anvil first?Sign up for free