Lab 2 -- Build Workflows Like Scripts¶
Pre-built workflows make automation quick and easy---no coding required! But since every network is different, automation needs can vary too. That's why Workflows offer hundreds of atomic actions across solutions, giving you the flexibility to customize any workflow or build your own from scratch. Think of it like LEGO® bricks: with hundreds (or even thousands) of pieces, you can assemble your own unique architecture, shaped by your creativity and style.
If a workflow were a script, each atomic action would be like a function from the SDK within that script. In this lab, you'll create a workflow to automate your lab network using the same operations as the Python script from the Meraki Dashboard API Jumpstart Lab.

Script Flowchart
-
Quick overview of the script flow: With a user-provided API key and target organization ID, the script will rename the campus network (box D) and switch device (E), update a switch port setting (F), rename the AP (G) in the same network, and create two SSIDs (H). With the Access Keys, Targets, and global variable configurations from Lab 1, you are ready to continue from step C in the flow chart above.
-
Navigate to Automation > Workspace, click Create workflow, choose the default Blank Custom Workflow, and then click Continue.

-
Name your workflow campus_automation and click Continue.
-
In the Properties panel, expand General and add the following to the Description.
"This workflow is intended for lab use to automate a Meraki campus network setup, including updating the network name, renaming devices, and configuring a switch port and two SSIDs."
Information
It's recommended to provide a detailed description. For instance, include the purpose of the workflow and how it should be used. Include details such as targets used and what steps should be performed. For additional Workflow best practices, please refer to the documentation.
-
Scroll down the Properties panel, click Variables, then under Local and static variables click + Add variable:
- Data Type: String
- Display Name: Target_Network_ID
- Scope: Local
- String Type: Text
- Value: type in None
Hint
Initialize Target_Network_ID to None for later comparison in the workflow.
-
Click Target, configure the Workflow Target as follows:
- Execute on this target
- Target Type: Meraki Endpoint
- Target: Meraki

-
In the Activities section on the left-hand side, search for the activity Meraki - Get Organization Networks (Step C), then drag and drop it onto the Workflow Canvas.

-
To retrieve organization networks, an organization ID is required, which is why the node on the canvas appears amber, waiting for input. In the Atomic Properties panel, under Input > Input - Organization ID, click the
icon to launch Variable Browser. Choose Global > LAB_ORG_ID and Save.


Information
The Variable Browser lets you explore activity variables, global and environment variables, workflow variables, incident response, and workflow outputs. Learn more about Variable Browser.
-
Click on the canvas to clear the warning. As a best practice, Validate and Run the workflow to test it before adding more activities.


-
The workflow run should show complete successfully. Click the Meraki -- Get Organization Networks activity and review the Output -- Result, which is an array containing the two networks in your lab organization.

-
Click Modify to continue adding the next activity - find any network whose name contains 'campus' and rename it to Workflows-Campus.

-
In the Activity panel, search Condition Block and drag it onto the canvas dropping it onto the green + just below the Get Organization Networks Atomic.

-
Rename the activity to Did Get Org Networks succeed?

-
Rename the first Condition Branch to 200/Success. Delete the second branch, as it won't be need.

-
Select the 200/Success branch, under Condition, configure it as follows:
- Property: Click the
and select Activities > Meraki -- Get Organization Networks > Output -- Status Code, Save the selection.

- Comparison: Equals
- Value: 200

Information
When an API request is sent, it's always best practice to verify that the previous call was successful before proceeding with the workflow.
- Property: Click the
-
In the left-hand Activity panel, search and drag Read Table from JSON activity to the 200/Success branch (Drag activity here). This activity will convert previous Meraki -- Get Organization Networks atomic output from a JSON string into a table for further processing.

-
Under Read Table, configure the Read Table from JSON activity as follows:
- JSON Path: $.
- Add two Columns to Read.
Name Type name String id String - Source JSON: Click the
and select Activities > Meraki -- Get Organization Networks > Output -- Result

Information
"$." is the JSON Path to select all objects in a JSON data (in our case, the Output -- Result from Meraki -- Get Organization Networks). To learn more, see the document Read Table from JSON/Text/XML.
-
Click Validate and then Run to quick test the flow. You should see another successful run.

-
Click Modify and return to the editing mode. To iterate through all networks in the table, add a For Each activity right after the Read Table from JSON activity.

-
Configure the For Each activity as follows:
- Display Name: Iterate Each Network
- Source Array: Click the
and select Activities > Did Get Org Networks succeed? > 200/Success > Read Table from JSON > Output

-
Click Validate, then Run the workflow to quickly test the flow so far.


-
Click the Iterate Each Network activity and examine the two iterations. Each iteration represents an item in the Source Array (in this case, the two networks in the lab organization)

-
Return to editing mode, inside the Iterate Each Network loop, drag a Condition Block activity and name it Was Workflow-Campus Found?

-
Configure the first condition branch as follows:
- Display Name: Found
- Condition > Property: Click the
and select Activities > Did Get Org Networks succeed? > 200/Success > Iterate Each Network > Source Array > Items > name - Condition > Comparison: Equals
- Condition > Value: type in Workflow-Campus

-
In the left-hand Activity panel, search and drag a Set Variables activity to the Found branch.

-
Configure the Set Variables activity as follows:
- Display Name: Set Campus Network ID
- Click + Add under Variables to update
- Variable to update: Click the
and select Workflow > Local > Target_Network_ID - New value: Click the
and select Activities > Did Get Org Networks succeed? > 200/Success > Iterate Each Network > Source Array > Items > id

Information
Variables enable efficient data management and communication within and between workflows and can be defined as input, output, or local. A single Set Variables activity can set or update more than one variable.
-
Select the Found branch, click the three dots in the right corner of the card, and then click Duplicate.

-
Configure the duplicated branch as follows.
- Display Name: Not found, but another Campus network name
- Condition > Comparison: Matches regular expression
- Value: type in (?i)campus

Hint
Using the activity duplicate option can help reduce the repetitive configurations steps.
AI Assistant Can Help
Not sure how to write the regular expression? Try using AI Assistant at your fingertips and send the following prompt: Create a regular expression to match any string that contains 'campus' and make it case insensitive.

-
In the Activity panel, search and drag a Meraki - Update Network activity to the Not found, but another Campus network name branch and put it after the Set Campus Network ID activity.
Note
In the Activities panel, make sure you select Meraki - Update Network listed under Cisco Meraki > Networks — not a similarly named activity from another category.

-
Configure the Meraki -- Update Network activity as follows:
- Input -- Name: type in Workflow-Campus
- Input -- Network ID to Update: Click the
and select Workflow > Local > Target_Network_ID

-
Configure the third branch as follows:
- Display Name: Not found/Skip
- Condition > Property: Click the
and select Activities > Did Get Org Networks succeed? > 200/Success > Iterate Each Network > Source Array > Items > name - Condition > Comparison: Matches regular expression
- Condition > Value: type in (?i)\^(?!.*campus).*

Hint
If the full activity name search doesn't work, search again without the "Meraki --"
Hint
Lab checkpoint#1: At this stage, your lab workflow should look like the snapshot shown here: Workflow Lab Checkpoint #1
-
-
A quick recap of the python script, you are now ready to move to step E, which update the switch device name in the Workflow-Campus network. Add a Condition Block before the flow END.


-
Update the Condition Block's Display Name to Was Workflow-Campus Network ID Set?

-
Delete the second branch.

-
Configure the condition branch as follows:
- Display Name: Yes
- Condition > Property: Click the
and select Workflow > Local > Target_Network_ID - Condition > Comparison: Not Equals
- Condition > Value: type in None
Note
The value must be entered exactly as "None".

-
Add a Meraki - Get Organization Devices atomic activity to the Yes branch and set Organization ID to Global > LAB_ORG_ID.

-
Add a Read Table from JSON activity after the Meraki -- Get Organization Devices activity.

-
Configure the Read Table from JSON activity as follows:
- JSON Path: $.
- Add the following Columns to Read:
Name Type serial String productType String networkId String - Source JSON: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > Meraki -- Get Organization Devices > Result
Note
The columns to read names must be entered the same with those in the table above.


-
Add a For Each activity and set the Source Array to Activities > Was Workflow-Campus Network ID Set? > Yes > Read Table from JSON > Output


-
Within the For Each activity, add a Condition Block and name it Workflow-Campus Network?

-
Configure the first Condition Branch as follows:
- Display Name: Yes
- Condition > Property: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > networkId - Condition > Comparison: Equals
- Condition > Value: Click the
and select Workflow > Local > Target_Network_ID - Click + Add condition to create a second condition.
- Condition > Property: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > productType - Condition > Comparison: Equals
- Condition > Value: type in switch

Hint
When building conditions, you can combine multiple conditions using AND or OR. In this step, ALL of these conditions must be met is selected.
-
Add a Meraki - Update Device activity to the Yes branch.

-
Configure the Meraki - Update Device activity as follows:
- Input -- Device Serial to Update: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > serial - Input -- Name: type in Workflow-Campus-Switch


Hint
Since there is only one switch in this network, the workflow keeps things simple by updating the device with a static name. But what if there are multiple switches in the same network? You can append the last 2--3 bytes of each device's MAC address to its name to differentiate them.
- Input -- Device Serial to Update: Click the
-
In the same branch, add a Meraki - Update Device Switch Port activity.

-
Configure the Meraki - Update Device Switch Port activity as follows:
- Input -- Port Id: 2
- Input - Allowed VLANs: 1-200
- Input -- Tags: ["wireless", "meetingroom"]
- Input -- Name: To-AP
- Input -- Serial: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > serial


-
-
You now are ready to automate the wireless device and configurations.

-
Configure the second Condition Branch as follows:
- Display Name: No but AP in the Workflow-Campus Network
- Condition > Property: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > networkId - Condition > Comparison: Equals
- Condition > Value: Click the
and select Workflow > Local > Target_Network_ID - Click + Add condition to create a second condition.
- Condition > Property: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > productType - Condition > Comparison: Equals
- Condition > Value: type in wireless

-
Drag a new Meraki - Update Device activity into the branch.

-
Configure the Meraki - Update Device activity as follows:
- Input -- Device Serial to Update: Click the
and select Activities > Was Workflow-Campus Network ID Set? > Yes > For Each > Source Array > Items > serial - Input -- Name: type in Workflow-Campus-AP

- Input -- Device Serial to Update: Click the
-
Add a Meraki - Update Network Wireless SSID activity after the For Each activity.

Note
Make sure this activity is out of For Each loop activity. The For Each loop here iterates through all 6 devices in the lab organization, but SSID configurations should be applied at the network level rather than repeated on each device.
-
Configure Meraki - Update Network Wireless SSID activity as follows:
- Display Name: Meraki - Update Network Wireless SSID -- Corp
- Input - Default VLAN ID: 99
- Input - WPA Encryption Mode: WPA2 only
- Input -- Enabled: true
- Input - Network ID: Click the
and select Workflow > Local > Target_Network_ID - Input - SSID Number: 0
- Input -- Name: type in Workflow-Corp
- Input - Auth Mode: 8021x-meraki
- Input - IP Assignment Mode: Bridge mode



Note
All the values should be case sensitive.
-
Add another Meraki - Update Network Wireless SSID.

-
Configure the activity as follows:
- Display Name: Meraki - Update Network Wireless SSID -- Guest
- Input -- Enabled: true
- Input - Network ID: Click the
and select Workflow > Local > Target_Network_ID - Input - SSID Number: 1
- Input - Encryption Mode: wpa
- Input -- Name: type in Workflow-Guest
- Input - Auth Mode: psk
- Input -- PSK: Global > SSID_PSK




Note
All the values should be case sensitive. For the Meraki -- Update Network Wireless SSID -- Guest SSID, make sure you set the parameter Input - Encryption Mode instead of Input - WPA Encryption Mode.
Hint
Lab checkpoint#2. At this stage, your lab workflow should look like the snapshot shown here: Workflow Lab Checkpoint #2
-
-
Ready to test your Lego architect -or explore opportunities to enhance it? Click Validate and then click Run to execute the workflow. Just like in Workflow Lab Checkpoint #3, after a successful run you should see:
- Success status next to the workflow run
- All run activities show green headers
- Two items under Iterate Each Network (representing the two networks in the lab organization)
- Six items in the For Each loop activity (representing six devices). One should trigger the switch device update branch (YES) and another should trigger the AP branch (No but AP in the Workflow-Campus Network)
- Updated campus network name, switch and access point device names, switch port (#2) settings, two SSID settings, etc.
- Finally, confirm and monitor all these changes in Organization > Change Log and Organization > API & Webhooks.
🎉 Congratulations on completing lab 2! 🎉
In this lab, you learned how to automate a Meraki network using the Workflow Editor, assembling atomic actions like LEGO® bricks---without writing code. You practiced leveraging pre-built Meraki atomics, conditions, loops, and variables to control automation logic for tasks such as updating networks and devices, configuring switch ports, and managing wireless SSIDs. Finally, you tested the workflow, verified the changes, and saw how tasks that would normally require custom scripts can instead be accomplished visually and efficiently using Cisco Workflows.