The API Timed Out. Did the Transaction Fail? Designing Safer IBM BAW Integrations

A practical guide to error handling, idempotency and controlled recovery in IBM Business Automation Workflow.

An approval completes. IBM BAW calls an ERP service to create a purchase order. The request times out. Support retries it. A few minutes later, the ERP contains two purchase orders.

The first request succeeded. Its response never reached the workflow.

Did the operation fail—or did we fail to receive confirmation?

That question changes how an enterprise workflow should handle integration failures. This article uses an illustrative procurement scenario, rather than a named client incident, to explain a recovery pattern for BAW BPMN processes and service flows. It is an application architecture pattern, not a claim that BAW provides end-to-end exactly-once execution.

1. A timeout is not a business outcome

Consider this sequence:

  • BAW sends an approved purchase-order request.
  • The ERP creates the purchase order and commits it.
  • The response is lost or arrives after the caller’s timeout.
  • BAW observes a failed call, while the ERP holds a completed transaction.
ERP transaction succeeds, but the response is lost; a blind retry can create a duplicate.
Figure 1. A timeout can occur after the external transaction commits. Without effective deduplication, a blind retry can create a duplicate.

A timeout establishes that the caller did not receive a response within its configured period. It does not establish that the receiver made no changes. Similarly, for an ordinary REST call, do not assume that a BAW-side rollback reverses an independently committed ERP transaction.

The design must account for both workflow state and external business state.

2. Classify the failure before deciding to retry

Start with two questions: what failed technically, and what is known about the business operation?

SituationRecovery decision
Business validation rejectionCorrect the request. Repeating unchanged invalid data will not fix it.
Authentication or authorization failureResolve credentials, permissions or configuration before a controlled replay.
Rate limitingFollow the provider’s retry contract and verify that replay is safe.
Timeout, interrupted connection or gateway errorDetermine whether the external operation may already have completed.
Server errorInvestigate outcome semantics. A server error does not universally prove that nothing committed.
Confirmed successful operationRecord the external reference and continue.

A status code is diagnostic evidence, not automatic permission to repeat a write. Interpret it against the API contract and the operation’s business impact.

3. Give the logical operation a stable identity

Before invoking a duplicate-sensitive operation, define an identifier for that intended business action.

Business request: PR-2026-004281
Operation: CREATE_PURCHASE_ORDER
Operation key: PR-2026-004281:CREATE_PO:v1

Preserve this key across retries of the same logical operation. Generating a new key on every attempt defeats deduplication.

  • Business request ID: identifies the procurement request.
  • Operation key: identifies one intended external action.
  • Attempt ID: identifies one execution attempt.
  • Correlation ID: links related logs and service calls.

The example key is illustrative. Choose a namespace that remains unique across the relevant applications and environments, and define how legitimate revisions or repeat business actions receive a new identity.

A header alone does not prevent duplicates

An Idempotency-Key header works only when the receiver explicitly supports and enforces that contract. Neither REST nor BAW automatically makes an arbitrary create operation idempotent.

The receiving API or integration layer must handle:

  • Concurrent requests with the same key.
  • The same key submitted with different request data.
  • An operation that is still in progress.
  • Returning the result of a completed operation.
  • A retention period covering realistic retries and operational recovery.

Deduplication and the business change must be coordinated atomically or through an equivalently robust design. A separate “check, then create” without concurrency protection can still allow duplicates. IBM’s integration architecture guidance discusses idempotence as a way for repeated requests to produce a single business effect.[1]

4. Build an integration wrapper with explicit outcomes

IBM BAW external services provide interfaces to applications outside the workflow. A service flow can invoke an external service and handle its response.[2]

For this scenario, a reusable wrapper should:

  1. Validate the outbound data.
  2. Obtain the stable operation key.
  3. Invoke the configured external service.
  4. Normalize successful responses and business rejections.
  5. Capture relevant error details.
  6. Return a controlled outcome or throw an appropriate error for its caller.

Possible application-defined outcomes are SUCCEEDED, BUSINESS_REJECTED, RETRY_PENDING, OUTCOME_UNKNOWN and MANUAL_REVIEW. These are custom states, not built-in BAW status values.

Use error boundary events deliberately

IBM documents error boundary events for catching activity errors in service flows, including HTTP errors returned by REST integrations.[3] IBM also documents catching errors from an underlying service flow at its calling activity in the parent process or service.[4]

Use the error path to capture, classify and route the problem. Do not catch every exception and return a success flag simply to keep the workflow moving. Map error data according to the actual service type and your installed BAW version; avoid assuming every failure has the same structure.

This article does not apply BPEL transaction retry settings to BPMN service flows. Those are different execution contexts and require their own configuration review.

5. Reconcile an uncertain outcome

When confirmation is missing, establish what happened through an authoritative mechanism:

  • Query the operation key or a unique business reference.
  • Read an integration-layer operation record.
  • Receive a correlated completion callback.
  • Ask an authorized operator to verify the external record.
Recovery decision tree separating confirmed success, business rejection and unknown outcomes, followed by reconciliation and safe retry or manual review.
Figure 2. Choose recovery from the confirmed business outcome and documented replay safety.

“Not found” is not always “never created.” The original request might still be running, or the lookup might read an eventually consistent replica.

Replay is justified when receiver-enforced idempotency safely handles the repeated operation, or authoritative evidence establishes that the original operation cannot still complete and the provider permits replay. Without that evidence, keep the outcome uncertain and escalate rather than blindly create again.

6. Make retries bounded, delayed and durable

A retry policy should define:

  • Maximum attempts and total elapsed recovery time.
  • Backoff delays and, where appropriate, jitter.
  • Which outcomes permit replay.
  • When recovery escalates and who owns it.
  • How planned maintenance and dependency outages are handled.

For example, a policy might permit an initial call followed by three retries after approximately 30 seconds, two minutes and ten minutes. Those are illustrative intervals, not recommended defaults for every integration.

For longer delays, use a modeled durable wait at the process level or an appropriate external scheduling or messaging design. Avoid keeping a synchronous execution occupied by sleeping threads or a tight loop. Configure and test timeouts across the caller, gateway and backend; increasing a timeout is not a substitute for safe recovery.

Where the provider returns Retry-After, follow its documented semantics. IBM’s API guidance describes that header for rate-limited requests.[5]

Check every retry layer

The workflow, client library, gateway and downstream service can each retry. If those policies operate independently, one business request can generate many backend attempts. Identify which layer owns recovery and verify the effective end-to-end behavior.

7. Preserve evidence that survives failure

An application-owned integration record should make the affected operation easy to locate:

  • Business request and BAW process instance IDs.
  • Operation key, attempt ID and correlation ID.
  • Operation name, endpoint alias and environment.
  • Outcome, error category and external reference.
  • Attempt count, timestamps, duration and next retry time.
  • Recovery actor and reason for manual action.

Decide how this evidence is committed. A log written inside a transaction that rolls back may disappear with it. Choose an approved application store or observability platform with understood persistence behavior.

Do not directly modify BAW internal runtime tables to implement recovery. Avoid logging credentials, tokens or unnecessary sensitive payloads. Establish retention and access controls for operational records.

8. Give support a controlled recovery action

A “Retry” button should validate more than user access. Before acting, the recovery service should confirm:

  • The operator is authorized for that action.
  • The operation has not already completed.
  • No other worker or operator is recovering it concurrently.
  • The payload still represents the intended operation.
  • Replay is allowed, with the original operation key preserved.

Record the actor, reason and result. Recheck the current state when the action executes, rather than trusting an old browser view.

Prefer recovery scoped to the affected logical operation. Review the actual execution scope of your chosen BAW recovery mechanism; do not assume it resumes at the exact failed statement without repeating earlier side effects.

9. Test the failures that expose the design

A happy-path demonstration is useful, but these tests provide stronger evidence:

  • ERP succeeds; response is lost: recovery must not create a second order.
  • Concurrent requests share a key: deduplication must hold under concurrency.
  • Validation fails: unchanged data must not loop indefinitely.
  • Rate limiting occurs: attempts must follow the agreed policy.
  • BAW restarts during a wait: recovery state must remain recoverable.
  • External success; local recording fails: reconciliation must retrieve the business reference.
  • Lookup says not found while work continues: replay must not be assumed safe.
  • Two operators trigger recovery: concurrent action must be controlled.
  • A key is reused with different data: the mismatch must be detected.
  • Limits are exhausted: the request must reach a visible, owned resolution path.

Can the external system succeed while the workflow believes it failed—and can the design recover safely?

10. Measure unresolved business work

Monitor operations awaiting reconciliation, the age of the oldest unresolved operation, retry volume, recovery success rate, manual review backlog and time to confirmed business completion.

An exception count shows that something broke. An unresolved-operation view shows which business requests still need attention.

What I would check in a design review

  • Can we establish what happened in the external system?
  • Can we safely repeat the intended operation?
  • Can support recover it with evidence and accountability?

If those answers are unclear, adding more retries will not resolve the design gap. A reliable workflow needs a recovery path designed as carefully as its approval path.

Need help reviewing your IBM BAW integrations?

I help teams with IBM BPM and BAW solution design, development, integration troubleshooting, root cause analysis and production support.

Discuss your requirement →

By Imtiaz Ahmed — IBM BPM/BAW Consultant and four-time IBM Champion.

Technical references

  1. IBM Redbooks: Accelerating Modernization with Agile Integration — integration architecture and idempotence.
  2. IBM BAW 24.x: Calling an external service.
  3. IBM BAW 24.x: Catching errors by using error boundary events.
  4. IBM BAW 24.x: Service flows — Handling errors.
  5. IBM Cloud API Handbook: Headers.

Implementation note: API contracts, transaction behavior and configuration differ by integration and deployment. The recovery states and policies here are design examples; validate them against your installed BAW version and external system guarantees.

Share this article

LinkedIn WhatsApp Email

Leave a Reply

Your email address will not be published. Required fields are marked *