Skip to content

Commit 3d9f0fb

Browse files
committed
add workflow to start
1 parent 1acfe67 commit 3d9f0fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vapi.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
CreateSquadDTO,
1818
CreateAssistantDTO,
1919
AssistantOverrides,
20+
CreateWorkflowDTO,
2021
} from './api';
2122
import { client } from './client';
2223

@@ -197,9 +198,10 @@ export default class Vapi extends VapiEventEmitter {
197198
assistant?: CreateAssistantDTO | string,
198199
assistantOverrides?: AssistantOverrides,
199200
squad?: CreateSquadDTO | string,
201+
workflow?: CreateWorkflowDTO | string,
200202
): Promise<Call | null> {
201-
if (!assistant && !squad) {
202-
throw new Error('Assistant or Squad must be provided.');
203+
if (!assistant && !squad && !workflow) {
204+
throw new Error('Assistant or Squad or Workflow must be provided.');
203205
}
204206

205207
if (this.started) {
@@ -215,6 +217,8 @@ export default class Vapi extends VapiEventEmitter {
215217
assistantOverrides,
216218
squad: typeof squad === 'string' ? undefined : squad,
217219
squadId: typeof squad === 'string' ? squad : undefined,
220+
workflow: typeof workflow === 'string' ? undefined : workflow,
221+
workflowId: typeof workflow === 'string' ? workflow : undefined,
218222
})
219223
).data;
220224

0 commit comments

Comments
 (0)