yesterday
Hi all,
I have create a workflow to query some switches and add the output to a file, in the next script of the flow I convert the file to a readable format.
only if selected multiple switches than the convert script block runs multiple times.
is the away in a workflow to run a script without the devices? Like the email part of the flow only runs once.
so the cirkelt part needs to run after and only once
kind regards
Mark
Solved! Go to Solution.
yesterday
Just for clarification, the device's variable applies to the entire workflow. TO let run a single activity, only one of many devices used you have to use another approach
use emc_vars['deviceIP'] to know the current device IP and emc_vars['devices'] where the list of all device IPs are contained. You can than check if the emc_vars['deviceIP'] in the first position of emc_vars['devices'] for let it run and all other have to stop the activity execution.
yesterday
Hi Mark,
You can achieve this by adding a conditional step in your workflow to check if the script has already run. Here’s a general approach:
Flag Check: Create a flag or a variable that indicates whether the script has run.
Conditional Execution: Before running the conversion script, check the flag. If the script has not run, execute it and set the flag.
Workflow Structure: Ensure that this check is placed outside of the loop that queries the switches, so it only runs once after all switches are processed.
This way, the conversion script block runs only once, similar to the email part of the flow.
yesterday
Hi lisa52smith,
i tried your solution but because the block run parallel for the switches the variable is still true at start of the script block, or i am doing something wrong.
in the second block it reads the workflow variable is if not true then do the conversion en set the variable to false. if variable is false juist print file already done. the variable is changed but because the block start at the same time for the selected switches the variable is still true.
hope this making some sense
thx for helping
kind regards Mark
yesterday
Hi Mark,
To run a workflow independently, you have to go to Details - Variables and delete the ones called devices.
yesterday
Just for clarification, the device's variable applies to the entire workflow. TO let run a single activity, only one of many devices used you have to use another approach
use emc_vars['deviceIP'] to know the current device IP and emc_vars['devices'] where the list of all device IPs are contained. You can than check if the emc_vars['deviceIP'] in the first position of emc_vars['devices'] for let it run and all other have to stop the activity execution.