Invoking Go activity from python workflow


I’m trying to invoke Go activity from Python workflow.
Please let me know if you have any sample code for such use case.

Also, is it possible to invoke go/python activity from NodeJS workflow?

There is an example for the inverse (invoking Python activity from Go): samples-python/activity_worker at main · temporalio/samples-python · GitHub. You can apply the same logic.

If you want the same task queue, you’ll want a Go activity-only worker (so make sure you set DisableWorkflowWorker in the Go worker options) and a Python workflow-only worker (so don’t pass any activities to the worker). Then in the Python workflow, you can execute_activity with the string name of the Go activity. Or if you want type checking in Python, you can make an empty stub of an activity with the same Go name (@activity.defn(name="GoFunctionName")) and parameter types and then reference that in execute_activity.

Yes, every Temporal language’s workflows can invoke every other Temporal language’s activities.

Hi Chad Retz,

Thanks for your quick reply. Will check the sample you have given for go-python.

Also, I’m trying following use case:

Invoking python/go activity from Nodejs workflow

Checked this sample but it doesn’t include above use case.
If you have any sample code for this use case let us know. Will refer that.

We don’t necessarily have a sample for every permutation of languages calling other languages (it’d be 5! samples currently) and that repo seems to have older version of TypeScript SDK. You should be able to create an interface for the other-language activities and use Namespace: workflow | Temporal TypeScript SDK API Reference. See the example there.

Also remember that an activity worker must have all the same activities for a task queue, so you can’t split activities of a task queue on different languages/workers. It would be best to use a different task queue for each set of activities/workflows.