hatchet-dev / hatchet

A distributed, fault-tolerant task queue
https://hatchet.run
MIT License
4.21k stars 157 forks source link

Typescript SDK: How to get workflow Id while creating via putWorkflow #849

Closed ahsansher closed 1 month ago

ahsansher commented 2 months ago

I'm creating workflow via admin.putWorkflow but it does not return anything. So, in this case, how I can get a workflow Id in case I have to delete it later?

I couldn't find anything in the sdk or docs.

SDK: Typescript

Thanks.

abelanger5 commented 2 months ago

Hi @ahsansher, unfortunately that SDK method does not return anything at the moment. The best option is to use the REST client to list workflows and get the workflow by name from there. We can add support for returning the workflow ID directly - it should be a very easy change if someone would like to pick it up: https://github.com/hatchet-dev/hatchet-typescript/blob/46bb07239d054761b67ab4cd1572383c71774bee/src/clients/admin/admin-client.ts#L81.

ahsansher commented 2 months ago

Okay @abelanger5. I'll have a look. Thanks.

ahsansher commented 1 month ago

@abelanger5 I have created a fix for this in the typescript-sdk repo. I've cloned the repo, and implemented fix on a new branch, now trying to push that branch but getting remote: Permission to hatchet-dev/hatchet-typescript.git denied. can you please share how exactly I can push my branch and open a PR? Thanks.

abelanger5 commented 1 month ago

Hi @ahsansher, you'll need to push to a fork of the repo, and then you can create a PR from the branch in your fork to the branch in the main repo.

More docs here: https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project

ahsansher commented 1 month ago

@abelanger5 I have created a PR for this fix here: https://github.com/hatchet-dev/hatchet-typescript/pull/346 Please have a look. Thanks.

abelanger5 commented 1 month ago

Closing as https://github.com/hatchet-dev/hatchet-typescript/pull/346 was merged