MCPcopy
hub / github.com/triggerdotdev/trigger.dev / triggerTask

Method triggerTask

packages/core/src/v3/apiClient/index.ts:113–126  ·  view source on GitHub ↗
(taskId: string, body: TriggerTaskRequestBody, options?: TriggerOptions)

Source from the content-addressed store, hash-verified

111 }
112
113 triggerTask(taskId: string, body: TriggerTaskRequestBody, options?: TriggerOptions) {
114 const encodedTaskId = encodeURIComponent(taskId);
115
116 return zodfetch(
117 TriggerTaskResponse,
118 `${this.baseUrl}/api/v1/tasks/${encodedTaskId}/trigger`,
119 {
120 method: "POST",
121 headers: this.#getHeaders(options?.spanParentAsLink ?? false),
122 body: JSON.stringify(body),
123 },
124 zodFetchOptions
125 );
126 }
127
128 batchTriggerTask(taskId: string, body: BatchTriggerTaskRequestBody, options?: TriggerOptions) {
129 const encodedTaskId = encodeURIComponent(taskId);

Callers 1

createTaskFunction · 0.80

Calls 2

#getHeadersMethod · 0.95
zodfetchFunction · 0.90

Tested by

no test coverage detected