resonate-external-system-of-record-pattern-rust

Write to external systems of record before executing idempotent Rust workflow side effects.

6|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-external-system-of-record-pattern-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resonate-external-system-of-record-pattern-rust
Source: https://github.com/resonatehq/resonate-skills/tree/main/resonate-external-system-of-record-pattern-rust
Command: npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-external-system-of-record-pattern-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents durable workflows from producing inconsistent business state by ensuring Resonate coordinates but does not contradict an external system of record (SoR); it enforces writing to the SoR first and making dependent side effects checkpointed and idempotent so retries do not create duplicate or conflicting outcomes.

Core Features & Use Cases

  • SoR-first writes: Patterns and idioms for performing idempotent inserts/updates to PostgreSQL or ledger systems before triggering side effects.
  • Type-dispatched dependency injection: Guidance for registering dependencies in the ephemeral world and retrieving them as Arc<T> inside durable functions.
  • Idempotency and deduplication: Use of deterministic invocation IDs, idempotency keys, ON CONFLICT SQL patterns, and ledger transfer IDs to ensure at-most-once external effects.
  • Use Case: Implement reliable order creation and payment charging where the database or ledger is the ground truth and external APIs (Stripe, fulfillment) are invoked only after durable SoR commits.

Quick Start

Ask for a Rust Resonate example that registers a PgPool and Stripe client as dependencies, inserts an idempotent order row into Postgres as the system of record, and then enqueues dependent side effects.

Frequently Asked Questions about resonate-external-system-of-record-pattern-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate side effects when retrying durable Rust workflows?

To prevent duplicate side effects in durable Rust workflows, write to the external system of record first using idempotency keys and checkpointed ctx.run leaf calls, ensuring dependent operations execute only after durable commits succeed.

What is the best way to keep Resonate Rust workflows consistent with PostgreSQL?

Keeping Resonate Rust workflows consistent with PostgreSQL requires inserting idempotent order rows using ON CONFLICT SQL patterns before triggering side effects, making the database the ground truth and preventing contradictory workflow states during retries.

How does type-dispatched dependency injection work for durable functions in Rust?

Type-dispatched dependency injection in Rust registers dependencies like PgPool and Stripe clients in the ephemeral world, then retrieves them as Arc<T> inside durable functions, providing shared state access without breaking workflow determinism.

Can I use TigerBeetle as a system of record for payment ledger transfers?

Yes, you can use TigerBeetle as a system of record for payment ledger transfers by applying deterministic ledger transfer IDs for idempotency, ensuring at-most-once external effects and deduplication when Resonate workflows retry.

When do I need idempotency keys for at-least-once execution in Rust workflows?

You need idempotency keys for at-least-once execution in Rust workflows whenever durable functions interact with external durable stores like PostgreSQL or Stripe, preventing duplicate order creation, payment charges, or conflicting ledger outcomes during automatic retries.

Does this Rust pattern support Stripe payment charging with external deduplication?

Yes, this Rust pattern supports Stripe payment charging with external deduplication by enforcing system-of-record-first writes to PostgreSQL, then enqueuing checkpointed dependent side effects to Stripe only after the durable database commit succeeds.