coinbase / temporal-ruby

Ruby SDK for Temporal
Apache License 2.0
213 stars 81 forks source link

How to trigger external workflow, or make an activities for external workflow (defined in different SDK) #271

Closed khangvo88 closed 4 months ago

khangvo88 commented 8 months ago

Hello,

I am trying to writing a Ruby Temporal activity that works with an (external) workflow defined in a different micro-service (writing Typescript SDK). When a Temporal server tries to pick up the activity from same queue, I have a issue "Workflow is not registered with this worker" It seems that an activity forced to be defined inside Ruby's Workflow, which we not want. What is the appropriate way to do it?

Also if I want to trigger any external workflow, which the current micro-service does not hold ownership for that workflow, what is the appropriate way to trigger it. Compared to temporalio/ruby-sdk, it claims support "Starting a workflow (defined in any other SDK)", e.g.

# Start a workflow
handle = client.start_workflow('MyWorkflow', 'some input', id: 'my-id', task_queue: 'my-task-queue')

How we can achieve the same with this SDK?

Thanks in advance.

DeRauk commented 5 months ago

Hi, sorry for the delay here. You shouldn't be getting that error in your workflow if you're only registering activities, if you're still having trouble can you reply with how you're starting your worker and registering your activities?

For your second question, I don't think we have an example in the repo but you can specify the name of a workflow to start by setting the name property on options. Link

khangvo88 commented 4 months ago

thanks for your clear response.