8000 feat(py-sdk): add support for `put_workflow` extending from base workflow by abelanger5 · Pull Request #329 · hatchet-dev/hatchet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(py-sdk): add support for put_workflow extending from base workflow #329

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

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

abelanger5
Copy link
Contributor

Description

Adds ability to programmatically create new workflows from the python SDK via put_workflow. Allows for a set of override values to get passed in through the optional overrides param. For example:

@hatchet.workflow()
class BaseWorkflow:
    @hatchet.step()
    def step1(self, context: Context):
        return {
            "result": "success!"
        }

    @hatchet.step(parents=["step1"],timeout='4s')
    def step2(self, context):
        return {
            "result2": "success!"
        }

hatchet.client.admin.put_workflow(
    "workflow-copy",
    BaseWorkflow(),
    overrides=CreateWorkflowVersionOpts(
        cron_triggers=["*/15 * * * *"],
        cron_input=json.dumps({"test": "test"}),
    ),
)

Type of change

  • New feature (non-breaking change which adds functionality)

@abelanger5 abelanger5 requested a review from grutt April 2, 2024 16:49
Copy link
vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 5:05pm

@abelanger5 abelanger5 merged commit d01736c into main Apr 2, 2024
@abelanger5 abelanger5 deleted the belanger/py-sdk-put-workflow branch April 2, 2024 17:29
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

Successfully merging this pull request may close these issues.

1 participant
0