elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

Workflow Templates

Open sfmskywalker opened this issue 4 years ago • 2 comments

Workflow Templates allows a given workflow to be placed inside a workflow template, similar to the way a Blazor component template allows a component to have one or more templated properties (render fragments) or a layout Razor page allows sections to be defined.

This enables scenarios where you want to allow for the customization of a part of a workflow that fits neatly within an outer workflow.

This is similar to having a master workflow calling into a child workflow, but inversed: the child workflow declares its parent (template) workflow, and is synthesized at runtime.

Workflow Template

A workflow template is a regular workflow, but marked as being a template so that:

  • They are never triggered
  • They can be selected from dashboard applications when creating child workflows.

Workflow Sections

When designing a workflow template, a special kind of activity called WorkflowSection becomes available acting as the placeholder for the "child" workflow to be stitched into. Workflow Templates can have multiple, named, sections. Each section's name appears on a child workflow as a starting node (as if the child workflow's root activities are connected to the parent workflows outcomes, where each outcome has the same name as the master workflow's sections).

Workflow Synthesis

Where normally a parent workflow would trigger a child workflow, workflow synthesis works differently: it takes the master workflow and child workflow and stitches them together by replacing the section activities with the root activities from the child workflow, forming a brand new workflow ready for execution.

sfmskywalker avatar Nov 17 '20 19:11 sfmskywalker