background shape
background shape
Sub-Workflow Activity: Best Practices

Sub-Workflow Activity: Best Practices

The Sub-workflow activity in Adobe Campaign Classic is a very powerful tool that allows you to incorporate and execute reusable workflows within your main workflow. It enables you to modularize and streamline your workflow design by breaking down complex processes into smaller, manageable components.

With the Sub-workflow activity, you can create separate workflows that handle specific tasks or actions and then include them as sub-workflows within your main campaign workflow. This promotes reusability, as you can use the same sub-workflow in multiple campaign workflows, saving time and effort in workflow creation and maintenance.

Key features and benefits of the Subworkflow activity in Adobe Campaign include:

  1. Workflow Modularity: Sub-workflows act as independent modules, focusing on specific actions or processes. This improves workflow organization and readability, making it easier to understand and maintain complex campaign workflows.
  2. Reusability: You can reuse sub-workflows in multiple campaign workflows, avoiding duplication of effort. This promotes consistency and reduces the need to recreate similar workflows from scratch.
  3. Workflow Composition: By integrating sub-workflows, you can create sophisticated and flexible campaign workflows by combining multiple reusable components. This allows for a modular approach to workflow design, enhancing overall workflow efficiency.
  4. Granular Control: Sub-workflows can be customized and configured with specific settings, parameters, and input/output variables. This provides granular control over each sub-workflow’s behavior and enables seamless integration with the main campaign workflow.
  5. Improved Collaboration: Sub-workflows facilitate collaboration among campaign managers and workflow designers by enabling them to work on specific components independently. Changes made to a sub-workflow are automatically reflected in all campaign workflows that include it.
  6. Improved Readability: The workflow can accommodate only a certain number of activities, as we are all limited by the same canvas size. Surely, you have encountered a workflow that contains numerous jump points, requiring you to scroll left and down to navigate. In such cases, we can utilize the Sub-workflow activity to encapsulate specific blocks of activities. This approach transforms the block into a black box-like function that performs its designated tasks without occupying excessive space on the workflow canvas. By employing this technique, we can effectively manage complex workflows while optimizing the use of available space.

How does the sub-workflow activity work

When executing a Sub-workflow activity, a new workflow is generated and initiated using the target population from the main workflow. After the sub-workflow successfully completes its execution, the temporary workflow created for it will be automatically removed, ensuring a clean workflow environment.

In the event of a sub-workflow failure, the details and logs of the failed sub-workflow will be available for further debugging. These can be accessed in the designated execution folder, allowing you to identify and address any issues. Once the necessary fixes or adjustments are made, you can proceed by pressing “play” or restarting the main workflow.

It’s important to note that any modifications or tweaks made during the execution of the sub-workflow are only applicable to the temporary workflow and do not impact the original template. If changes are required, they should be applied to the template itself. This ensures that the sub-workflow retains its intended structure and behavior, as modifications made within the temporary workflow will be discarded once it is removed.

How to set sub-workflow activity

To be able to use Sub-workflow activity we will need to create workflow template that will be used in the Sub-workflow activity of the main workflow.

  1. Build a technical workflow and execute it, making adjustments as needed until you are satisfied with its performance and results.
  2. Duplicate the workflow and save it as a template, leaving the default settings intact during the template creation process. You can change the execution folder if you wish to be aligned with the type of subworkflow you build e.g. if it is campaign worklfow use Campaign workflows and if it is technical worklfow then use Targeting workflows folder.
  1. Integrate a “Jump (end point)” and a “Jump (Start point)” activity into the workflow, ensuring that the jump number of the end point is lower than that of the start point.
  2. Save the modified template.
  3. Create a new workflow and add a Sub-workflow activity. Choose the previously saved workflow template as the sub-workflow.
  4. Execute the main workflow to initiate the process.

Example sub-workflow activity

In our example, we will develop a waterfall diagram feature that allows us to visualize the anticipated drop in recipient target before actually executing the campaign workflow and applying typology rules to the actuall delivery. We intentionally do not exclude the target population in order to observe the corresponding drop in the delivery logs for subsequent data analysis.

To achieve this, we utilize a Fork activity at the beginning of the workflow to make the incoming target population available as an output of the sub-workflow. This ensures that the target population remains intact and accessible for further processing.

For actual waterfall we have implemented a Split activity to accommodate any filtering rules specified in the typology rules or on the delivery template. This includes actions such as deduplication, quarantine, and opt-out, which may impact the distribution of recipients within the workflow. Not demonstrated in our specific example, we can extend the functionality by reconciling our target population with the nms:address table. This reconciliation allows us to identify and account for recipients who have been quarantined.

You can notice that we are using JavaScript activity after every split subset or fork transition, this is to capture counts in each and send it back to the main workflow. I capture population count to vars. instead to instance variables (you can also use instance.vars but in my case I went and used vars. only. You can read more about variables in Adobe Campaign Classic them in my blog post)

vars.optOut = vars.recCount;
  1. Jump (end point): jump number has to be lower than the Jump (start point)
  2. Jump (start potint): has to be greater then Jump (end point)
  3. Workflow logic: any business logic you want to achieve with the sub-workflow
  4. AND-Join: to pass any vars. defined in the JavaScript activity and also let the incoming target to be on the output

The Sub-workflow activity can be applied in various scenarios to enhance workflow management and promote modularization and code reusability. Here are some examples where the Sub-workflow activity can be useful:

  1. Data Processing: Use sub-workflows to perform specific data processing tasks such as data cleansing, data transformation, or data enrichment. These sub-workflows can be reused across multiple campaigns or workflows, ensuring consistent and efficient data processing.
  2. Personalization: Implement sub-workflows to handle personalized content generation or dynamic content insertion. Sub-workflows can fetch personalized data, apply rules for content personalization, and generate customized content for each recipient.
  3. Decision Making: Create sub-workflows to handle decision-making processes within larger workflows. These sub-workflows can evaluate conditions, perform calculations, or make complex decisions based on input data, simplifying the main workflow and improving its readability.
  4. Notification Systems: Develop sub-workflows that handle notifications or alerts within a larger workflow. These sub-workflows can trigger notifications based on specific events or conditions, such as sending email notifications to administrators or updating a notification log.
  5. API Integration: Utilize sub-workflows to integrate with external APIs or systems. These sub-workflows can handle the interaction with the external services, retrieve data, perform necessary transformations, and pass the results back to the main workflow for further processing.
  6. Error Handling: Implement sub-workflows to handle error or exception scenarios. These sub-workflows can catch and handle errors, perform error logging, send notifications, or initiate recovery actions to ensure the overall workflow execution remains stable and resilient.
  7. Workflow Orchestration: Use sub-workflows to orchestrate complex workflows by breaking them down into smaller, manageable components. Each sub-workflow can handle a specific task or step, and the main workflow coordinates the execution and sequencing of these sub-workflows.

Do you have any other implementation examples or use cases? Let me know in the comments.

Oh hi there 👋
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

We don’t spam! Read our privacy policy for more info.

Share With Others

Leave a Comment

Your email address will not be published. Required fields are marked *

MarTech consultant

Marcel Szimonisz

Marcel Szimonisz

I specialize in solving problems, automating processes, and driving innovation through major marketing automation platforms.

Buy me a coffee