cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
312
Views
4
Helpful
3
Replies

Dynamically select a target from a target group during execution

thein3rovert
Community Member

Hi all,

I'm building a workflow that is triggered via a webhook. The webhook sends a JSON request body containing a target_device field with the IP address of the device the workflow should execute on.

The problem I'm running into is around target selection. My target group contains multiple devices, and I need the workflow to execute only on the device whose IP matches the one in the webhook payload.

I've tried the following approaches:

  • All targets in this group — executes on every device in the group, not just the one from the webhook
  • Conditions (Host/IPAddress Equal input variable) — the input variable is populated by a Python node inside the workflow, but the condition is evaluated before the workflow starts so the variable is always empty
  • Conditions (Host/IPAddress Matches Wildcard webhook request body) — the raw JSON string doesn't work as a wildcard pattern so it matches nothing
  • Specify target on workflow start — only works for manual runs, not webhook-triggered executions

Is there any way to dynamically resolve a target from a target group at execution time using a value from the webhook payload? Or is there a recommended pattern for webhook-triggered workflows that need to execute on a specific device in a target group?

Any help appreciated!

2 Accepted Solutions

Accepted Solutions

@thein3rovert Great question. Here's my solution, I'm curious if others have a different method.
This does require the use of two workflows.
The first workflow is the parent workflow. This is the dispatcher. It is triggered by the webhook and parses the webhook request body for the IP address of the device.
The second workflow is the worker sub-workflow. It is called by the dispatcher workflow and passed the IP address of the device (along with any other required data from the webhook). This sub-workflow uses a Target Group that includes all of the devices and a Condition that compares the Property "Host/IPAddress" of the target to the sub-workflow Input variable IP Address.

EdNovakCiscoWorkflowsTME_0-1779311451822.png

I'm really curious if anyone else has a different way to do this?

Network Platform Team
Workflows - Technical Marketing Engineer

View solution in original post

@thein3rovert I'm glad to hear that you have a working solution now and thank you for the feedback. I'll pass that along to the product team for consideration.  Please remember that you can also always use the "Give your feedback" button on the bottom right of most pages in the Meraki Dashboard. This feedback goes directly to the team for the page you are on. So use this button from any page under the Automation menu to submit feedback on Workflows.

Network Platform Team
Workflows - Technical Marketing Engineer

View solution in original post

3 Replies 3

@thein3rovert Great question. Here's my solution, I'm curious if others have a different method.
This does require the use of two workflows.
The first workflow is the parent workflow. This is the dispatcher. It is triggered by the webhook and parses the webhook request body for the IP address of the device.
The second workflow is the worker sub-workflow. It is called by the dispatcher workflow and passed the IP address of the device (along with any other required data from the webhook). This sub-workflow uses a Target Group that includes all of the devices and a Condition that compares the Property "Host/IPAddress" of the target to the sub-workflow Input variable IP Address.

EdNovakCiscoWorkflowsTME_0-1779311451822.png

I'm really curious if anyone else has a different way to do this?

Network Platform Team
Workflows - Technical Marketing Engineer

thein3rovert
Community Member

Thank you @Ed Novak - Cisco Workflows TME for the solution. I got it working using the dispatcher + worker pattern and it makes sense once you understand the platform's execution model.

One thought I wanted to share as feedback — it would be amazing if there was a way to resolve targets dynamically at the workflow level, so you could use runtime data like a webhook payload to filter which target to execute on. Right now since target resolution happens before the workflow starts, you need a dispatcher workflow just to pass in an IP, which adds a bit of overhead for what is essentially a single operation.

It would be great to see a "resolve target at runtime" option in a future release — essentially allowing a variable or expression to be evaluated dynamically when selecting a target, rather than requiring a dispatcher workflow to pass the IP in beforehand. This would make webhook-driven automation significantly cleaner, especially for teams building multi-operation workflows.

Just wanted to share the feedback in case it's useful for the roadmap. Thanks again for the help!

@thein3rovert I'm glad to hear that you have a working solution now and thank you for the feedback. I'll pass that along to the product team for consideration.  Please remember that you can also always use the "Give your feedback" button on the bottom right of most pages in the Meraki Dashboard. This feedback goes directly to the team for the page you are on. So use this button from any page under the Automation menu to submit feedback on Workflows.

Network Platform Team
Workflows - Technical Marketing Engineer