New App Builder published backend appears to reuse stale prepared statement

  1. My goal:
    I am building a Restaurant Staff Management app in Retool App Builder. Staff should be able to CLOCK IN from the published app, including when they have no scheduled shift.

  2. Issue:
    When a Staff user presses CLOCK IN in the published app, the backend returns:

"bind message supplies 5 parameters, but prepared statement requires 12"

The current backend source has been verified to use exactly:

  • 5 PostgreSQL placeholders ($1 through $5)
  • 5 supplied parameters

I also created a brand-new backend function, attendanceV2, with the corrected 5-parameter query and updated the Time Clock to call attendanceV2.

However, the published production app still returns the same 12-parameter prepared-statement error.

  1. Steps I’ve taken to troubleshoot:
  • Republished the app multiple times
  • Closed and reopened the published app
  • Verified the current backend source
  • Confirmed the query uses exactly 5 placeholders and 5 parameters
  • Created a new backend function: attendanceV2
  • Updated the frontend Time Clock to call attendanceV2
  • Published again
  • Tested with a Staff user in the End User / published app

The same error persists.

I also tried submitting this through Retool's "Report a breakage" form, both with and without an attachment, but that form itself returns:
"Error submitting breakage report"

  1. Additional info:
  • Retool Cloud
  • App: Restaurant Staff Management
  • Workspace: kinyoubiizakaya
  • Affected backend functions: attendance.ts and attendanceV2.ts
  • Issue occurs in the published End User app
  • Screenshots available showing both the CLOCK IN error and the breakage-report submission error

The source and production runtime appear to be out of sync, or the deployed runtime may be reusing a stale prepared statement/serverless backend artifact.

Could someone from Retool please check the deployed backend/runtime and advise how to invalidate or refresh the stale prepared statement/function state?

Summary

In Retool's new App Builder (Cloud), a published Restaurant Staff Management app returns a stale error on CLOCK IN — "bind message supplies 5 parameters, but prepared statement requires 12" — even though the current backend function uses exactly 5 placeholders/parameters, a corrected new function (attendanceV2) was created, the frontend was repointed to it, and the app was republished multiple times. The deployed runtime appears to be executing an older version of the backend code.

AI Response

This matches a known synchronization behavior in the new App Builder where manual edits to backend function (.ts) files don't reliably persist and the runtime keeps executing an older committed version, even after repointing the frontend to a new function. Manual Code tab edits are tracked in Change History alongside agent edits, and there can be a delay before an edit is actually persisted via a commit — until it commits, the previous version continues to run. Before republishing, open the Change History drawer and confirm the corrected attendance/attendanceV2 code is actually recorded as a committed change under your name (not still pending, blank, or overwritten by an agent edit); make edits only when no agent operation is running, and avoid editing view-only files. Once the corrected version is confirmed committed in Change History, republish so the deployed runtime picks up the current source rather than the stale prepared statement.

Sources

:bookmark: Subject: App Builder backend function edits are reverting / not persisting
A new App Builder (Cloud) report of the same behavior — backend .ts edits reverting/reopening blank and the Timeline/Preview executing an older synchronized version even after the frontend was repointed to a new function — with staff confirming edits can lag until committed, visible in the Change History drawer.
:bookmark: Manually edit app code | Retool Docs
Documents manually editing app code in the new App Builder's Code tab, including how Change History distinguishes user vs. agent edits and how agent regeneration or view-only files can cause manual backend edits to appear not to save.

The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a :heart:, :+1:, or :-1:. Or by marking this post as the "Solution"! Let us know if you have any feedback here. :rocket:

Thanks. The linked backend-function persistence issue appears very similar to what I am seeing, but the problem is still unresolved.

My current source and the newly created attendanceV2 function both use exactly 5 placeholders and 5 parameters, yet the published End User app still returns:

bind message supplies 5 parameters, but prepared statement requires 12

I have republished multiple times and created a new backend function, so I would appreciate it if a Retool engineer could check whether the deployed runtime is executing stale backend code or prepared statement state.

Hey @Kinyoubi_Izakaya_Japanese - thanks for your patience. I'm looking into this now. Have you tried making any other cosmetic edits/updates to the app just to confirm that the deployed runtime is indeed being updated when republishing?

Can you also let me know if you're still seeing anything similar? The most recent backend error that matches exactly is from 9/15.