Run a task immediately
client.promptly.tasks.run(stringtaskID, RequestOptionsoptions?): TaskRun { id, completedAt, costCents, 9 more }
POST/api/promptly/tasks/{taskId}/run
Execute a task immediately, regardless of its schedule
Parameters
taskID: string
formatuuid
Returns
Run a task immediately
import _0ct from '0ct';
const client = new _0ct({
apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted
});
const taskRun = await client.promptly.tasks.run('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(taskRun.id);{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"completedAt": "2019-12-27T18:11:19.117Z",
"costCents": 0,
"createdAt": "2019-12-27T18:11:19.117Z",
"deliveryStatus": "pending",
"durationMs": 0,
"error": "error",
"output": "output",
"startedAt": "2019-12-27T18:11:19.117Z",
"status": "pending",
"taskId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"tokensUsed": 0
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"completedAt": "2019-12-27T18:11:19.117Z",
"costCents": 0,
"createdAt": "2019-12-27T18:11:19.117Z",
"deliveryStatus": "pending",
"durationMs": 0,
"error": "error",
"output": "output",
"startedAt": "2019-12-27T18:11:19.117Z",
"status": "pending",
"taskId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"tokensUsed": 0
}