Create reusable Workflows package?

Hi!

We are currently trying to build a package exporting multiple activities and workflows to be used as building blocks in another project. I’m failing to find a way how to register workflow definitions from a package dependency in a Worker (Package A exports workflows, Package B imports the definitions from A and creates a client).

From my understanding the only way to achieve something like that would be that each package/folder of workflow definitions has to be paired with it own worker and task queue name.

This seems to make reusing workflows for multiple applications very painful. I assume there’s some core concept I did not understand, could anyone enlighten me?

Can you show what you’re trying to do and what isn’t working?

Re-exporting a symbol in Typescript looks like export { foo };, but I assume you are having some other problem?

Hi @awwx,

Thank you for the response! I did not consider this option, actually, as I was too focused on passing the location of the workflow definitions to temporal. Reexporting works, my problem is solved. I feel a bit embarrassed, but in my defense, it was Friday evening.

Thanks a lot!

Oh that happens to me all the time! “It would have been obvious if I had thought of it, but I didn’t happen to think of it.” :melting_face:

Also, if your question is now solved, I recommend clicking on the “Solution” button, as that lets other people in the forum know that your question isn’t still open.

1 Like