OpenAI batch finished notifications on your phone.

Get a push notification when an OpenAI Batch API job completes, fails, expires or is cancelled.

How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into OpenAI

Add it as a webhook for batch.completed, batch.failed, batch.expired and batch.cancelled.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the OpenAI batch.completed, batch.failed, batch.expired and batch.cancelled webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In the OpenAI platform, open Settings > Project > Webhooks (platform.openai.com/settings/project/webhooks) and click Create.
  3. Give the endpoint a name and paste your webhook URL as the URL.https://••••••••/•••••••• your personal URL, shown after install
  4. Tick the batch.completed, batch.failed, batch.expired and batch.cancelled event types and save. Webhooks are per project, so repeat this for each project you want pushes from.
  5. Tick **batch.completed**, **batch.failed**, **batch.expired** and **batch.cancelled** (or only the ones you want).
  6. OpenAI's webhook only carries the batch ID, so the push says which batch finished and links to it in the dashboard. Download the results with `GET /v1/batches/{id}` and the Files API.
  7. Only want to hear about problems? Add `?failures=1` to the URL and completed or cancelled batches stay quiet:
  8. ```
  9. your webhook URL?failures=1
  10. ```
  11. The **Send test event** option on the webhook page sends a sample event with a made-up ID (such as `batch_abc123`), so the button on that push won't find a batch.
  12. OpenAI signs every delivery (Standard Webhooks: `webhook-id`, `webhook-timestamp`, `webhook-signature`), but JustPush doesn't check that signature yet, so keep your endpoint URL private.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// OpenAI → batch.completed / batch.failed / batch.expired / batch.cancelled
2// Fires when a Batch API job finishes, fails, runs past its completion window or is cancelled.
3// Docs: https://developers.openai.com/api/reference/resources/webhooks
4//
5// OpenAI only sends the batch ID (data.id). The push links to the batch in the dashboard.
6
7// Each event, how to word it, and how loud to be.
8const EVENTS = {
9 "batch.completed": {
10 title: "✅ Batch completed",
11 text: "finished. The output file is ready to download",
12 priority: -1, // Low: good news you were waiting for
13 failure: false,
14 },
15 "batch.expired": {
16 title: "⏰ Batch expired",
17 text: "didn't finish within its completion window. Check which requests completed",
18 priority: 0, // Normal: partly done, worth a look
19 failure: true,
20 },
21 "batch.failed": {
22 title: "❌ Batch failed",
23 text: "failed. Check the batch errors",
24 priority: 1, // High: nothing got processed
25 failure: true,
26 },
27 "batch.cancelled": {
28 title: "🚫 Batch cancelled",
29 text: "was cancelled",
30 priority: -1, // Low: someone cancelled it on purpose
31 failure: false,
32 },
33}
34
35// Table lookup that ignores inherited names such as "toString".
36function pick(table, key, fallback) {
37 return typeof key === "string" && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback
38}
39
40// Only link to real http(s) URLs.
41function link(url, cta) {
42 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
43}
44
45// OpenAI IDs look like "batch_abc123"; anything else isn't used in text or links.
46function cleanId(value) {
47 return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value) ? value : null
48}
49
50function handleRequest(request) {
51 const body = request.body && typeof request.body === "object" ? request.body : {}
52 const event = pick(EVENTS, body.type, null)
53
54 // Guard: only batch events, so other OpenAI events on this integration stay quiet.
55 if (!event) {
56 console.log(`Ignoring OpenAI "${typeof body.type === "string" ? body.type : "unknown"}" event`)
57 return null
58 }
59
60 // ?failures=1 on the webhook URL only pushes failed and expired batches.
61 const failuresOnly = ["1", "true", "yes"].includes(String(request.query?.failures ?? "").toLowerCase())
62 if (failuresOnly && !event.failure) {
63 console.log(`Skipping ${body.type} (failures only)`)
64 return null
65 }
66
67 const id = cleanId(body.data?.id)
68
69 return {
70 title: event.title,
71 message: `${id ? `Batch ${id}` : "A batch"} ${event.text}.`,
72 topic: "OpenAI",
73 priority: event.priority,
74 buttons: link(id ? `https://platform.openai.com/batches/${id}` : "https://platform.openai.com/batches", "View batch"),
75 }
76}
Payload

The OpenAI batch.completed webhook

This is what OpenAI sends to your URL for batch.completed, batch.failed, batch.expired and batch.cancelled. It is a sample, trimmed to the fields recipes use.

batch.completed · sample.json
1{
2 "id": "evt_685343a1381c819085d44c354e1b330f",
3 "data": {
4 "id": "batch_abc123"
5 },
6 "type": "batch.completed",
7 "object": "event",
8 "created_at": 1790668800
9}
FAQ

OpenAI batch finished notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into OpenAI and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

OpenAI on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.