Idempotent workflow engine for financial operations

Financial workflows · AML · DEX · Idempotency

Idempotent workflow engine for financial operations

A withdrawal, token swap or large deposit is rarely one action. Fees, limits, AML screening, approvals and blockchain execution must happen in a controlled order.

Instead of duplicating conditional logic in controllers, the TON service runs each operation through a configured workflow whose intermediate state is stored in the database.

Stepspersisted state
Keyidempotent start
Locksingle worker
AMLfail closed
Resumeafter failure

An operation is an ordered workflow

Configured steps

Each operation type defines named handlers such as validation, fee calculation, AML, approval and execution.

Persisted progress

Input, output and status of every step are stored so a restarted worker resumes instead of starting over.

Extensibility

A new rule for one asset or operation is introduced through configuration and a handler, not a copied controller branch.

Idempotency and execution locks

Idempotent start

Repeating the initiation key returns the existing workflow rather than creating a second financial operation.

Distributed lock

Only one worker may advance a specific workflow at a time.

Step-level repeat safety

A completed step is not executed again; external calls carry their own idempotency identifier where supported.

AML must fail closed

If screening is required and the provider is unavailable, times out or returns an invalid response, execution stops for review. Lack of a risk result is not treated as approval.

Explicit outcomes

Clear, review and reject are separate states with stored provider evidence.

Manual review

An operator can inspect context and record a controlled decision under audit.

DEX execution

Quote expiry, slippage, allowance, transaction submission and confirmation use the same recoverable-step model.

Technology and delivery

Engine Configured handlers · persisted steps · retries · distributed locks
Finance AML · DEX swaps · fees · approvals · blockchain confirmation

Expected result

Financial workflows that resume safely after failures, never skip required risk controls and cannot be started or executed twice by concurrent retries.

Workflow Engine · Idempotency · AML · Fail Closed · DEX · Locks · Recovery

Discuss your project

If you have a project involving Python, Laravel, Node.js, CRM, Telegram, AI/RAG, API integrations, automation or TON/GRAM logic, send me a short description of what you need.

You can simply explain what exists now, what is not working, what outcome you expect and which services are already involved.


Let’s discuss your project

Tell me what you would like to build. I will reply by email.

Or message me on Telegram @ifwcom