Action Batches
The Meraki API has the ability to combine multiple "actions" into a single request, where an action is typically a "PUT/POST/DELETE" request. This reduces the frequency of calls to the API where the rate limit and increases the speed for a large number of changes.
Meraki Action Batch Docs
This flow uses Action Batches to provision several ports on multiple switches in a single request to Meraki. It then periodically checks the state of the Action Batch ID, when run in an asynchronous mode.
flow.json
Many of the techniques desribed in this guide are applied in this flow. The first line of flow sets the various msg
parameters, such as msg.serials
, msg.portNumbers
and msg.payload
.
The Build Actions function node is where the magic happens. This JavaScript function will iterate through each of the serials and create an action forEach
serial, applying settings forEach
of the port numbers.
Once the action has been sent to Meraki, a response will include the ID of the batch, the status and the actions that were sent.
We can use the batchId
by first storing it in our flow context. Then, use a trigger node with this ID to getOrganizationActionBatch
status. If the status has not been completed, the trigger will send a new request every second until complete.