Skip to content

Accept the problem-document body on the sync webhook timeout - #24

Open
stuartc wants to merge 1 commit into
mainfrom
accept-problem-document-timeout
Open

stuartc wants to merge 1 commit into
mainfrom
accept-problem-document-timeout

Conversation

@stuartc

@stuartc stuartc commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Lightning's upcoming API error refactor, OpenFn/lightning#5239, changes the 504 reply on a sync webhook timeout.

Lightning used to send {error: "timeout", message: "...", work_order_id} and will now send a problem document: {type, status, title, code: "timeout", detail: "The workflow did not finish in time.", work_order_id}.

As far as I can tell the worker/kit doesn't use this endpoint and/or doesn't depend on the response body.

I've changed the timeout test in tests/lightning-worker/sync-webhook.spec.ts to only check that the status is 504, and that work_order_id is the run's id, and that the timeout code is "timeout" in either code or error. It no longer checks the human-readable message. The header comment describes both shapes. No other test changed.

I ran the spec file locally against both Lightning refs, with WORKER=latest:

  • Lightning main (a3d16403d0): Test Files 1 passed (1), Tests 10 passed (10)
  • #5239 (6335ecfb95): Test Files 1 passed (1), Tests 10 passed (10)

Lightning's workflow uses @v1, so once this merges we need to update that it before OpenFn/lightning#5239 is merged.

Lightning's upcoming API error refactor (OpenFn/lightning#5239) sends the
504 timeout reply as a problem document with code: "timeout" instead of
error: "timeout". Check the status, the work order id and the timeout code
in either field, and stop asserting the human-readable text.
@stuartc
stuartc requested a review from doc-han October 23, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant