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 workflows from webhook #2667

Closed
alexec opened this issue Apr 10, 2020 · 15 comments · Fixed by #3488
Closed

Trigger workflows from webhook #2667

alexec opened this issue Apr 10, 2020 · 15 comments · Fixed by #3488
Assignees
Labels
type/feature Feature request
Milestone

Comments

@alexec
Copy link
Contributor

alexec commented Apr 10, 2020

Summary

Allow automated scripts to trigger workflows from a webhook.

Motivation

Simplify trigger or workflows.

Proposal

TBD


Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

@alexec alexec added the type/feature Feature request label Apr 10, 2020
@alexec alexec added this to the Backlog milestone Apr 10, 2020
@nHurD
Copy link
Contributor

nHurD commented Apr 12, 2020

I'm curious how this would differ from Argo Events?

@sarabala1979
Copy link
Member

This is mainly to support simple use-case like just user wants to trigger the workflow/workflows based on webhook invoke. Argo Event is a sophisticated application to support many usecases with multiple event sources, condition-based trigger, and complex event trigger logics.

@salanki
Copy link
Contributor

salanki commented Apr 13, 2020

Triggering Workflows via the new REST API is already pretty simple, however it requires a Workflow body even when triggering a WorkflowTemplate.

Is the idea here to support triggering a WorfklowTemplate by simply including parameters in the query? Ie /api/submit/workflowtemplate/my-template?param1=cow&param2=say? I can see that being very useful, I've built my own proxy for this for my own usage.

@alexec
Copy link
Contributor Author

alexec commented Apr 13, 2020

The biggest difference for this would be the use of a token (like GITHUB_TOKEN) to escalate an anonymous user to one that is able to submit workflows as the system user. This makes it much easier and safer to use.

@salanki
Copy link
Contributor

salanki commented Apr 13, 2020

Yup, that makes a lot of sense.

@sarabala1979
Copy link
Member

sarabala1979 commented Apr 13, 2020

Triggering Workflows via the new REST API is already pretty simple, however it requires a Workflow body even when triggering a WorkflowTemplate.

Is the idea here to support triggering a WorfklowTemplate by simply including parameters in the >query? Ie /api/submit/workflowtemplate/my-template?param1=cow&param2=say? I can see >?>that being very useful, I've built my own proxy for this for my own usage.

In V2.7, Argo workflow has a Submittable workflowtemplate . User can submit the workflowtemplate as workflow. Webhook should have a generalized Authentication mechanism to authenticate the call.

@nHurD
Copy link
Contributor

nHurD commented Apr 14, 2020

Wow, this sounds pretty awesome! Would the result of this return the generated name of the new workflow?

@alexec
Copy link
Contributor Author

alexec commented Apr 16, 2020

@whynowy has an example of how to do this, but the big challenge is that the payload of different systems varies. E.g. https://developer.github.com/webhooks/

Argo Events would be able to do this:

https://argoproj.github.io/argo-events/tutorials/03-trigger-sources/#git

@whynowy
Copy link
Member

whynowy commented Apr 16, 2020

@alexec
Copy link
Contributor Author

alexec commented Apr 16, 2020

@whynowy do you want to add your Google do to /docs?

@alexec alexec removed this from the Backlog milestone Jun 9, 2020
@alexec alexec changed the title Trigger workflows from web hook Trigger workflows from webhook Jun 29, 2020
@alexec alexec self-assigned this Jun 30, 2020
@alexec
Copy link
Contributor Author

alexec commented Jul 9, 2020

Please review the proposal:

https://github.com/alexec/argo/blob/cloudevents/docs/events.md

@alexec
Copy link
Contributor Author

alexec commented Jul 15, 2020

@alexec
Copy link
Contributor Author

alexec commented Jul 21, 2020

Please remember to 👍 #3344 if you want to be able to resume suspended workflows.

@alexec
Copy link
Contributor Author

alexec commented Jul 21, 2020

@alexec
Copy link
Contributor Author

alexec commented Sep 2, 2020

Available for testing in v2.11.0-rc1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
5 participants