Skip to content

Webhook execution fails on Kubernetes in latest SIM AI image due to idempotency_key database error #7294

Description

@SAljajith

Webhook execution is not working in the latest SIM AI Docker image when deployed in Kubernetes.

The webhook endpoint itself is working correctly. When the same webhook endpoint is triggered manually using Postman, the request is received successfully.

However, when the webhook is triggered from SIM AI, the execution fails internally in the DatabaseJobQueue while processing the idempotency_key record. Because of this failure, the actual webhook request is not sent to the target endpoint.

Environment
Application: SIM AI
Deployment: Kubernetes
Container: Latest SIM AI Docker image
Feature: Webhook execution
Component: DatabaseJobQueue
Database table: idempotency_key
Steps to Reproduce
Deploy the latest SIM AI Docker image in Kubernetes.
Configure a webhook in SIM AI.
Trigger the webhook from SIM AI.
Check the SIM AI pod logs.
Trigger the same webhook endpoint using Postman.
Expected Behavior

SIM AI should successfully execute the webhook and send the HTTP request to the configured webhook endpoint.

Actual Behavior

The webhook request is not sent from SIM AI.

The execution fails in DatabaseJobQueue while processing the idempotency_key database query.

Error Log
timestamp=2026-08-31T08:51:18.333Z
level=ERROR
module=DatabaseJobQueue
message=[webhook-execution] Inline job run_T6VfedZQBRGQywKhent- failed
requestId=f30d69a0
method=POST
path=/api/webhooks/trigger/4a4c3c85-9633-4e48-9e1c-320d55df5e4e

error=Failed query:
insert into "idempotency_key"
("key", "result", "created_at")
values ($1, $2, $3)
on conflict ("key") do update
set "result" = $4,
"created_at" = $5
where (
(
"idempotency_key"."result" ->> 'status'
IS DISTINCT FROM 'in-progress'
AND "idempotency_key"."created_at" < $6
)
OR
(
"idempotency_key"."result" ->> 'status' = 'in-progress'
AND COALESCE(
CASE
WHEN jsonb_typeof(
"idempotency_key"."result" -> 'inProgressExpiresAt'
) = 'number'
THEN (
"idempotency_key"."result" ->> 'inProgressExpiresAt'
)::double precision
END,
EXTRACT(EPOCH FROM "idempotency_key"."created_at") * 1000 + $7
) <= $8
)
)
returning "key"
Verification

The same webhook endpoint was tested using Postman:

Postman: Request received successfully.
SIM AI on Kubernetes: Request is not received.
SIM AI logs: Webhook execution fails in DatabaseJobQueue.
Additional Information

The failure appears to occur before SIM AI sends the actual HTTP request to the webhook endpoint.

Please investigate the idempotency_key handling and DatabaseJobQueue logic in the latest SIM AI Docker image, particularly when running in a Kubernetes environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions