Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger different workflows from single Sensor #174

Closed
groodt opened this issue Feb 19, 2019 · 5 comments
Closed

Trigger different workflows from single Sensor #174

groodt opened this issue Feb 19, 2019 · 5 comments

Comments

@groodt
Copy link
Contributor

groodt commented Feb 19, 2019

Is your feature request related to a problem? Please describe.
I have a use-case where we have many scheduled workflows using the Calendar Gateway.

Right now, for every scheduled workflow, there is a Sensor that is deployed. This feels a little unnecessary as the containers are mostly idle while waiting for a single event to be triggered.

Describe the solution you'd like
It feels like it should be possible to have a Sensor have multiple triggers, so that the Sensor can trigger different workflows.

Describe alternatives you've considered
Kubernetes native Cronjobs offer an alternative, but you can't embed Argo Workflows directly.

Additional context
Add any other context or screenshots about the feature request here.

@VaibhavPage
Copy link
Contributor

VaibhavPage commented Feb 19, 2019

This is addressed in upcoming release v0.8, have a look at #162

Example - https://github.com/argoproj/argo-events/blob/master/examples/sensors/webhook-http-dependency-groups.yaml

You will be able to group event dependencies and apply any arbitrary boolean logic for these groups. On top of it, you'll be able to define when to execute triggers on ( any or all ) conditions.

@groodt
Copy link
Contributor Author

groodt commented Feb 19, 2019

That looks great! I look forward to trying it out.

A quick look at the example seems to indicate that the new functionality I'm looking for is:

  triggers:
    - name: webhook-workflow-trigger
      when:
        any:
          - "group_1"
          - "group_2"

So for the Calendar Gateway, I can configure multiple schedules in the ConfigMap, setup a single Sensor with multiple dependencyGroups and have multiple triggers using the new when and any/all declaration to control when the workflows are fired?

@VaibhavPage
Copy link
Contributor

Exactly. And the circuit to resolve the groups would be circuit: "group_1 || group_2" if you just have two groups.

@groodt
Copy link
Contributor Author

groodt commented Feb 19, 2019

Thanks. I didn't notice the circuit element. I think I understand how this new setup works.

This seems like it probably addresses my issue. I'll wait for 0.8 to be released and try it out.

@groodt groodt closed this as completed Feb 19, 2019
@sharadhirao
Copy link

Hi Team,
I was also looking for the same solution.

I have multiple eventsources, when any one of them triggers, I should be able to run the workflows. I have made values dynamic, so single sensor is enough for me. It feels like it should be possible to have a Sensor with multiple triggers defined and when any one of the dependencies triggers sensor should run.

I am not able access this link: https://github.com/argoproj/argo-events/blob/master/examples/sensors/webhook-http-dependency-groups.yaml

Can you suggest a solution on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants