Open mjameswh opened 1 year ago
I think for a basic starter here, you can just show the same activity (name and types) in each lang and a sample workflow calling it from each lang (including the interfaces/mocks representing the activity). Then you can explain the caveats about conversion, task queue, etc.
Brief description
Dev guides should include explanations of cross-SDK usages. Doc would follow a similar structure for all languages, but explanations and code example would have to be tailored to each language.
We have a few samples of polyglot usage scenarios here and there, but they are mostly "proof of concept", providing no explanation and no guidance on how to replicate. They also grow quite inefficiently relative to the number of languages (need ~NxNx8 samples to cover all combinaissons, but ~Nx8 samples to document it thoroughly).
Your recommended content
Note: The text below has been extracted from a Slack conversation regarding TS Workflows calling Python activities.
startWorkflow
/executeWorkflow
directly (ie. workflow type as a string)Using a Workflow in $thisLanguage to execute an Activity in another language
scheduleActivity
directly (ie. activity type as a string) — This is a little bit easier, but you get absolutely no type safety checking on the Workflow side. Simply callscheduleActivity
, with the activity name and args. You will also need to provide the task queue name and timeout.const {myActivity} = proxyActivities({ taskQueue: 'my-python-worker-taskqueue', scheduleToCloseTimeout: '10m' });
async function myWorkflow(...) { ... // Your Workflow may call
myActivity
just the same as if it was a TS activity! const result = await myActivity({ ... }); ... }