File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ export default class WorkflowContext {
96
96
}
97
97
98
98
/**
99
+ * Deprecated, use callChildWorkflow
99
100
* Schedule sub-orchestrator function for execution.
100
101
*
101
102
* @param orchestrator A reference to the orchestrator function call
@@ -115,6 +116,26 @@ export default class WorkflowContext {
115
116
return this . _innerContext . callSubOrchestrator ( getFunctionName ( orchestrator ) , input , instanceId ) ;
116
117
}
117
118
119
+ /**
120
+ * Schedule child workflow for execution.
121
+ *
122
+ * @param orchestrator A reference to the orchestrator function call
123
+ * @param input The JSON-serializable input value for the orchestrator function.
124
+ * @param instanceId A unique ID to use for the sub-orchestration instance. If not provided, a new GUID will be used.
125
+ *
126
+ * @returns {Task<TOutput> } A Durable Task that completes when the sub-orchestrator function completes.
127
+ */
128
+ public callChildWorkflow < TInput , TOutput > (
129
+ orchestrator : TWorkflow | string ,
130
+ input ?: TInput ,
131
+ instanceId ?: string ,
132
+ ) : Task < TOutput > {
133
+ if ( typeof orchestrator === "string" ) {
134
+ return this . _innerContext . callSubOrchestrator ( orchestrator , input , instanceId ) ;
135
+ }
136
+ return this . _innerContext . callSubOrchestrator ( getFunctionName ( orchestrator ) , input , instanceId ) ;
137
+ }
138
+
118
139
/**
119
140
* Wait for an event to be raised with the name "name"
120
141
*
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ describe("Workflow", () => {
139
139
140
140
const parentWorkflow : TWorkflow = async function * ( ctx : WorkflowContext ) : any {
141
141
// Call sub-orchestration
142
- yield ctx . callSubWorkflow ( childWorkflow ) ;
142
+ yield ctx . callChildWorkflow ( childWorkflow ) ;
143
143
} ;
144
144
145
145
workflowRuntime
You can’t perform that action at this time.
0 commit comments