Best Approach for Handling Variable Payloads in Subflows (Flow Designer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2025 04:40 PM
Scenario:I have a Flow Designer implementation which has 2 action:
Action 1:
Inputs for the action -1
input1: abc
input2: def
input3: xyz
Steps inside Action 1:
- Payload Builder – builds the JSON payload using the inputs shown above.
- REST API Call – sends the payload to AWX and triggers a job.
- Output: AWX job ID (from response) and status code.
Action 2:
Takes AWX job ID as input and checks job status (successful, failed, running, pending).
I repeat Action 1 and Action 2 for four different playbooks (Playbook1 to Playbook4). To avoid duplication, I plan to create a subflow that encapsulates these actions.
Subflow Design:------Inputs:
input1: abc
input2: def
input3: xyz
playbook1 has a different payload which needs input 1 , 2 and 3
playbook 2 has a different payload which needs input 4, 5 , 6 , 7
playbook 3 has combination of common - input 1 , 2 , 6 and 7
how can i handle the variation in the input ? can you suggest me any best practice solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2025 01:35 AM
Hi, @maddy2517 .
First, we follow functional programming principles and write our actions to be referentially transparent.
Next, we configure a flow that can distribute variables to subflows so that all the arguments provided can be managed.
Then, within the subflow, you can call actions and configure them to return responses with the granularity you require.
Thanks and Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2025 05:07 PM
Thanks for response @mugi-san can you be more specific with respect to the above requirement
i do have couple of options :
OPTION 1 : generate payload as action outside of sub flow and use that as input based on which playbook you want to trigger
OPTION 2 : take a combination (union) of al inputs required to generate payload for playbook 1 , 2 , 3 , 4
and make them non-mandatory so that when you build using " payload-builder" you will have key with empty value , now its on how you write the playbook to handle things
wanted to hear feedback , suggestion or any other best practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2025 06:47 PM
Hi, @maddy2517 .
Configure actions within a subflow so that each playbook can be created using a single subflow.
If multiple playbooks are required,invoke multiple subflows from the main flow.
However, based on my understanding of the process you provided,
it seems you may also be aiming to reduce the number of API calls needed to generate the payload.
Since my logic does not take that into account, it may not be helpful as a reference.
Regards
