MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / completeTask

Method completeTask

packages/trigger-sdk/src/apiClient.ts:168–188  ·  view source on GitHub ↗
(runId: string, id: string, task: CompleteTaskBodyV2Input)

Source from the content-addressed store, hash-verified

166 }
167
168 async completeTask(runId: string, id: string, task: CompleteTaskBodyV2Input) {
169 const apiKey = await this.#apiKey();
170
171 this.#logger.debug("Complete Task", {
172 task,
173 });
174
175 return await zodfetch(
176 ServerTaskSchema,
177 `${this.#apiUrl}/api/v1/runs/${runId}/tasks/${id}/complete`,
178 {
179 method: "POST",
180 headers: {
181 "Content-Type": "application/json",
182 Authorization: `Bearer ${apiKey}`,
183 "Trigger-Version": API_VERSIONS.SERIALIZED_TASK_OUTPUT,
184 },
185 body: JSON.stringify(task),
186 }
187 );
188 }
189
190 async failTask(runId: string, id: string, body: FailTaskBodyInput) {
191 const apiKey = await this.#apiKey();

Callers 1

#doCompleteTaskMethod · 0.80

Calls 3

#apiKeyMethod · 0.95
zodfetchFunction · 0.70
debugMethod · 0.65

Tested by

no test coverage detected