Suppose I have workers written in different languages (Java & C#). Each registered activities and workflows in the Cadence server. Is it possible to create a workflow which invokes activities from both workers ?
Asked
Active
Viewed 210 times
1
-
How do you run C# worker? I know there is a community library for Cadence but it's not being maintained anymore. – Long Quanzheng Nov 03 '21 at 04:00
-
I'm using Neon.Cadence. I'm able to run workflows (on the same cadence server) using activities (and workflow) separately (C# or Java) but if I can use mix activities in the same WF or invoke another WF (in a different worker written in another language) it can completely decouple my projects and allow development of separate domains in "any" language. – Luke Nov 03 '21 at 08:07
-
@Luke can you share some of your code? I tried that library, couldn't get it to work - it just hangs forever – chester89 Aug 10 '23 at 11:10
1 Answers
0
Yes it's possible. And it would be much easier if you implement the workflow in Java.
The only thing you need to deal with is how to translate the activity input/output and exception between C# activity and Java workflow.
To achieve that, you need to write some customized code for DataConverter interface. See this sample.
Basically, you need to define special Input/output/exception classes for C# activity. For toData
, convert to the data format for C# client. For fromData
and fromDataArray
, convert back to the classes of Java.
I assume Neon.Cadence use JSON so input/output should be easy. You just need to pay more attention to exception.

Long Quanzheng
- 2,076
- 1
- 10
- 22