cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
466
Views
4
Helpful
1
Replies

My Experience: GitHub Repos for Meraki Workflows

SandroNa
Cisco Employee
Cisco Employee

Hi all,

I recently wanted to start using a GitHub repository for my workflow management, especially to keep things consistent across different Meraki organizations. It took me a little bit of trial and error to get it to work properly, so I wanted to share my experience here.

Just a quick disclaimer: I'm not saying this is the absolute "single source of truth," but this is what I discovered and how it finally worked for me. I hope writing this out helps somebody in the future! Also, my conclusions might only be partially correct, so if anyone wants to add their two cents or clarify anything, you are more than welcome.

A huge thanks to this YouTube video which was the only place I could find this specific information!

Here is the breakdown of how the Git names, imports, and folder structures need to be set up:

1. The Base Folder (Optional)

If you are using an optional folder to house your workflows, it must be defined during the Git repository definition in your workspace [Automation > Workspace > Workflows > Actions > Manage Git Repositories]
Code Path

SandroNa_0-1778662798706.png

2. Folder and File Naming Structure

The naming convention is very strict. The structure should look like this:

 

optional_folder/
├── Workflow1__workflow_unique_name/
│ └── workflow_unique_name.json
├── Workflow2__workflow_unique_name/
│ └── workflow_unique_name.json

 

The Rules:

  • Folder Name: FileName__workflow_unique_name
    • It must be the File Name (with no spaces), followed by a double underscore (__), followed by the workflow's unique name/ID.
    • Example: NetworkConfiguration__definition_workflow_xxxxxxxxx
  • File Name: The JSON file inside that folder must be named using only the workflow unique name.
    • Example: definition_workflow_xxxxxxxxx.json

SandroNa_1-1778663041991.png

3. A Real-World Example

To put this into perspective, let's use the official Cisco DevNet Workflows Automation repo (https://github.com/CiscoDevNet/CiscoWorkflowsAutomation) as an example.

Repository Definition:

  • REST API Repository: api.github.com/repos/CiscoDevNet/CiscoWorkflowsAutomation
  • Branch: main
  • Code path: Meraki

SandroNa_2-1778663073438.png

Resulting File Structure: Based on the above definition, the file structure looks like this:

 

Meraki/
├── BlinkMerakiDeviceLEDs__definition_workflow_02NXTSAQL5ZNK3kEJpVUecfDz1ZNss1zGXd/
│ └── definition_workflow_02NXTSAQL5ZNK3kEJpVUecfDz1ZNss1zGXd.json
├── CheckAvailableFirmwareForNetwork__definition_workflow_02M30GYJJSYJL0wQPPnkQgIcavBkG6796mF/
│ └── definition_workflow_02M30GYJJSYJL0wQPPnkQgIcavBkG6796mF.json

 

4. Importing the Workflow

Once your repository is set up, you can easily bring it in using the import option. Just navigate to: Automation > Workspace > Workflows > Actions > Import Workflow

From there, select the Git tab, choose your repo, pick the file and the version, and happy importing!

SandroNa_3-1778663237133.png

A quick note on this: Until I nailed down the exact file structure and naming conventions I mentioned above, the "Filename" dropdown menu simply wouldn't populate for me when using my repo. I did some minor testing with other naming conventions without any luck. In the end, I just mimicked what was already available in the Cisco DevNet repo, and it worked perfectly!

Hopefully, having this written out here will save someone some time and make it much easier to find when Googling for a solution. Let me know if this works for you, or if you have any other tips or corrections to share!

Cheers!

~~If you found this post helpful, please give it a vote up. ~~
1 Reply 1

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

Awesome information.