08-01-2025 02:05 PM
I'm using network tags for Insight monitoring. During an outage, our team might remove one of those tags so that it doesn't continuously alert for a network that we know is down. However, we won't always remember to reapply the tag after the network is back up.
I'm trying to create a workflow that reapplies those tags to specific networks once a week. Not every network in the organization uses Insight, so I don't want to reapply tags to every network. I have a list of network names that should have the tags, and I've been trying to create a conditional statement around that, but haven't had much luck.
The workflow starts by getting all networks in the organization and then reading name and id into a table. I then have a 'for logic' with an embedded conditional. What I want to do is look at the retrieved network name and then try to wildcard match it with a String Array variable that has the networks we want the tags to reapply to. The intention is to then use a generic API call on the retrieved networkId for each network on the list to reapply specific tags. Unfortunately, it doesn't look like I can select the String Array variable I manually created. It will let me select a regular string variable, but I haven't had much luck getting it to match anything in the variable. I was able to pick the source array that gets populated after getting all networks in the org.
I'm not very experienced in programming so I'm not sure if I'm going about this the right way or just making it more complicated than it needs to be. Fortunately, everything else seems to work, I just can't get it to match on the list of networks I want to match on! Should I be able to select a manually created string array variable to match on a conditional?
Solved! Go to Solution.
08-01-2025 06:39 PM
Interesting use case. Workflows can certainly be used to automate this in a number of different ways. I wouldn't try to use a string array in a conditional, and you don't need to use the generic API call to get network tags. I can think of a few ways to do this.
1. Instead of just removing the Insight tag, swap in a different tag like "Replace me", and then create a workflow that is triggered by a schedule Rule to run once a week that would get all networks with the "Replace me" tag and then remove the "Replace me tag" and add back the original Insight tag. You could use the Meraki - Get Organizational Networks Atomic, which will take as an optional parameter Query - Tags This will return just the networks with the Query - Tag, so much less operationally complex. You'll end up with a short list of networks that you would need to remove the one tag and add the other. The Meraki - Update Network Atomic could be used.
2. Another option is to use the same Meraki - Get Organizational Networks and use the Query - Tags optional parameter. This will give you a list of networks that are tagged with Insight. Then I'd use a Execute Python Script activity to compare the list of networks that are still tagged and your list of networks that should all be tagged and have the Python code return a list of networks that aren't on both lists. Don't worry if you aren't familiar with Python. You can provide two sample lists and your intent to a tool like Chat GPT and it will generate the Python code for you. Then you would just need to iterate through your reduced list of untagged networks to re-apply your tag. A for loop with a Meraki - Update Network Atomic would do this. You would need the Network ID, but the System provided Meraki - Get Network by Name workflow can get this for you.
3. If you just want to iterate through the entire list of networks that should be tagged, you could. Start with a loop, and then inside, use the Meraki - Get Network by Name workflow to get the Network ID. This will also return other network information like tags. Then a conditional to check the tags, and if not present, in that logic branch, use a Meraki - Update Network Atmoic to add the tag.
If you haven't already done so, I'd review the Workflows Self-Learning videos
When using loops, please keep in mind the loop limitations.
It may be helpful to review the example workflow Select and Schedule Firmware Update by Network Tag this has an example of using the Meraki - Get Organizational Networks and the Query - Tags parameter to create a list of networks with the provided tag.
08-01-2025 06:39 PM
Interesting use case. Workflows can certainly be used to automate this in a number of different ways. I wouldn't try to use a string array in a conditional, and you don't need to use the generic API call to get network tags. I can think of a few ways to do this.
1. Instead of just removing the Insight tag, swap in a different tag like "Replace me", and then create a workflow that is triggered by a schedule Rule to run once a week that would get all networks with the "Replace me" tag and then remove the "Replace me tag" and add back the original Insight tag. You could use the Meraki - Get Organizational Networks Atomic, which will take as an optional parameter Query - Tags This will return just the networks with the Query - Tag, so much less operationally complex. You'll end up with a short list of networks that you would need to remove the one tag and add the other. The Meraki - Update Network Atomic could be used.
2. Another option is to use the same Meraki - Get Organizational Networks and use the Query - Tags optional parameter. This will give you a list of networks that are tagged with Insight. Then I'd use a Execute Python Script activity to compare the list of networks that are still tagged and your list of networks that should all be tagged and have the Python code return a list of networks that aren't on both lists. Don't worry if you aren't familiar with Python. You can provide two sample lists and your intent to a tool like Chat GPT and it will generate the Python code for you. Then you would just need to iterate through your reduced list of untagged networks to re-apply your tag. A for loop with a Meraki - Update Network Atomic would do this. You would need the Network ID, but the System provided Meraki - Get Network by Name workflow can get this for you.
3. If you just want to iterate through the entire list of networks that should be tagged, you could. Start with a loop, and then inside, use the Meraki - Get Network by Name workflow to get the Network ID. This will also return other network information like tags. Then a conditional to check the tags, and if not present, in that logic branch, use a Meraki - Update Network Atmoic to add the tag.
If you haven't already done so, I'd review the Workflows Self-Learning videos
When using loops, please keep in mind the loop limitations.
It may be helpful to review the example workflow Select and Schedule Firmware Update by Network Tag this has an example of using the Meraki - Get Organizational Networks and the Query - Tags parameter to create a list of networks with the provided tag.
08-04-2025 09:08 AM
Thanks for the reply Ed! The self-learning videos were super helpful with getting me this far.
I was able to get #3 to work for our lab networks, so I think this'll be a good fit for our production networks. I'd really been struggling to find a way to correlate networkId with the network name on the list I was providing, and the "Meraki - Get Network by Name" workflow did the trick. I must've completely overlooked it before!
As a side note, since we use several different network templates, the "Meraki - Get Network by Name" workflow kept failing to find the networks I was looking for. Maybe there was an easier way around it, but I ended up making copies of both "Get Organization Networks" atomic and "Meraki - Get Network by Name" workflow and editing them to remove the templateId requirement.
08-04-2025 06:05 PM
Glad to hear you are making progress on your automations. Yes, that is a value of workflows, being able to edit the provided workflows and atomics to meet your requirements. Could you please share more information about what was not working with those for your networks with templates?
08-06-2025 01:17 PM
When running the Meraki - Get Organization Networks by itself, I get prompted for "Is bound to config template" and can specify true/false and a template ID, but I don't get that same prompt with Meraki - Get Network by Name, so I think the workflow defaults to false and only returns networks that aren't bound to a template.
08-06-2025 06:34 PM - edited 08-07-2025 02:48 AM
Thank you for the details. Yes, the standard Meraki Atomics are based on the associated Meraki APIs and should support all of the query parameters. The System provided workflow Meraki - Get Network by Name was created by the Workflows team and does not use template parameters. A benefit of Workflows that you have discovered is that you have the ability to edit these System provided workflows and customize them for your use case. I have shared your feedback with the engineering team and they will improve that workflow to return networks with templates as an enhancement in the future version of that System workflow. Thank you for bringing this to our attention.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide