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

generic workflow plugin that calls a API endpoint to trigger a workflow #1764

Merged
merged 4 commits into from Oct 28, 2021

Conversation

jtorvald
Copy link
Contributor

I created a plugin that can interact with an API to kick-off workflows and retrieve its status.
This makes it more flexible to add various workflow engines and have them decoupled from Dispatch.
My idea is to make a sample API to start a workflow on the Temporal workflow engine without needing to add all the dependencies to the Dispatch project.

The plugin accepts a URL of an API endpoint that can handle both POST and GET requests.
It can be authenticated with the Authorization header, which can be filled with for example a JWT token or basic auth.

This is my first Python code since I once touched it for a couple of weeks 20 years ago so if you have any feedback or requirements to change please let me know.

@lgtm-com
Copy link

lgtm-com bot commented Oct 27, 2021

This pull request introduces 1 alert when merging f188adf into 151df0f - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization

@kevgliss
Copy link
Contributor

I don't have any serious issues with this, although I am a little bit curious about how useful it will be? Do you expect to be able to control the response generally? Most workflow engines I've seen have their own RestAPIs with responses particular to them. Does Temporal allow for arbitrary endpoints and responses to kick off new jobs?

@kevgliss kevgliss added the enhancement New feature or request label Oct 27, 2021
@jtorvald
Copy link
Contributor Author

@kevgliss I see it more as a proxy kind of solution. Now I can build a super small rest API in Go that triggers a temporal workflow and returns the status. With temporal you program your workflows in code anyway.

Another advantage is that It would help me to build a solution in a language I'm used to. I think it can also help the support of other workflow systems because you can program some glue in between that can handle the two requests from Dispatch and translate the request/response to another system.

@lgtm-com
Copy link

lgtm-com bot commented Oct 27, 2021

This pull request introduces 1 alert when merging 28b97ca into dfade7d - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization

@kevgliss
Copy link
Contributor

lgtm, thanks!

@kevgliss kevgliss merged commit 07ab458 into Netflix:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants