Configure a webhook endpoint in your application to receive run completion events. This is the recommended approach as it eliminates the need for polling and provides real-time updates.
When a run completes, Vern will send a POST request to your configured webhook URL with the following payload:
You can configure your webhook URL in the Vern dashboard.
Configure a webhook endpoint in your application to receive run completion events. This is the recommended approach as it eliminates the need for polling and provides real-time updates.
When a run completes, Vern will send a POST request to your configured webhook URL with the following payload:
You can configure your webhook URL in the Vern dashboard.
If you prefer a simpler approach, you can poll for the run to complete using a helper function:
Copy
async function pollRunUntilComplete(runId, interval = 10000) { while (true) { const runDetails = await vern.runs.retrieve(runId); if (runDetails.status === "completed") { return runDetails; } await new Promise((resolve) => setTimeout(resolve, interval)); }}const completedRun = await pollRunUntilComplete(run.id);// completedRun.result will have the extracted response data when done (if specified)