---
topic: ai-technology
author: Crashtech Editorial
published: Nov 27, 2026 · read: 4 min
---

Mastra 1.86 Makes Knowledge Imports Recoverable, Not Magically Exactly Once

Mastra's experimental importer runner adds leases, cursors, replay protection and batch transactions; teams still need to design for partial source reads.

– –
A paper workflow pauses on one in-flight experiment card, then resumes that card from a durable event ledger while completed items remain recorded.
Conceptual workflow: durable bookkeeping helps recovery, while replay-safe effects still require careful design.

A knowledge sync job can fail after it writes some pages but before it records that the source cursor advanced. Restart it carelessly and the job may duplicate work or skip updates; leave its status stuck at “running” and an operator has to decide what happened. Mastra 1.86 adds experimental Knowledge importers and a managed runner that stores binding, cursor, run and write-receipt bookkeeping alongside Knowledge data. The point is recoverable synchronization, not a promise that external work happens exactly once. [1] [2]

An importer is a configured connection to one source, such as a help desk. It reads source items and presents them with stable source IDs; Knowledge maps those IDs to pages, so a later import updates existing pages instead of appending copies. The runner can batch changes and persist the cursor with a batch’s writes in a storage transaction. Mastra says this system is experimental, and the initial release supports in-memory, PostgreSQL and LibSQL stores. [1] [2]

A cursor is part of the write

A cursor is the source-side checkpoint: for example, the timestamp after which a ticket system should return changed records next time. If a batch writes pages and advances that cursor atomically, a crash cannot commit one side of that pair without the other. But that only protects the state inside the Knowledge store. The source API can still return a partial page of results; the importer docs say a cursor can advance past refused items, which means the importer author must explicitly resend those items if they need repair. A transactional cursor is not a substitute for validating the source read. [2]

Stable sourceId values do similar work for replay. If the same source item comes through again, it maps to the same page. The docs also make deletion semantics conservative: an item missing from one run is left alone because a partial read should not erase knowledge; removal must be explicit when the source says an item was deleted or archived. That choice prevents a transient source outage from deleting content, but it makes source-side tombstones or another explicit delete signal part of a correct integration. [2]

These are the details that make an importer’s lifecycle more than “fetch then upsert.” A source binding needs a namespace, stable IDs, a cursor policy, transaction-capable storage and an explicit plan for refused items, renamed items, deletions and partial responses. For teams already running stateful background work, the same fundamentals appear in our distributed queue design guide and message-broker failure patterns.

Durable execution can rerun an unfinished step

The same release adds durable dataset experiments: each item can execute as a step in an evented workflow, so a worker interruption or redeploy need not strand the whole experiment as running. If a broker redelivers an unacknowledged event, another worker can pick it up. Mastra describes one result per experiment item in this path. [1]

The general workflow documentation supplies an important operational caveat: when a worker stops during a step, that step can run again if its result was not saved. A saved step result is not run again on a late redelivery, but an in-flight external effect may already have happened before the crash. If that effect is an API write, email or payment, use an idempotency key or an outbox/reconciliation pattern. Durable orchestration can remember progress; it cannot retroactively make a third-party action transactional with your database. [3]

Likewise, “durable” depends on the engine and infrastructure. Mastra’s docs distinguish local/default execution from evented execution; cross-process recovery needs supported shared storage and PubSub components. Stream replay caches have their own retention and eviction behavior. A developer should check the recovery path for the exact engine and backing services they deploy rather than treating one configuration flag as a durability guarantee. [4]

A safer first importer

Pick a source with a stable identifier and an API that can list changes deterministically. In a disposable corpus, import the same page twice, interrupt a run between batches, and feed a partial or refused source item. Check that a retry updates rather than duplicates, that the cursor does not hide data you meant to repair, that deletions require explicit source evidence, and that external side effects tolerate replay. Those tests map the new lifecycle bookkeeping to the failure cases it is meant to handle.

Mastra 1.86 gives framework users a clearer place to put this logic and durable records to resume it. Because the importer contract is experimental and the exact behavior belongs to each adapter and source, keep the rollout narrow. The durable win is that a failed sync can be understood and continued; correctness still comes from stable identity, transactional boundaries and deliberate replay behavior. [1] [2] [3]

Advertisement

Frequently asked questions

What changed for Mastra Knowledge importers in version 1.86?

Mastra added an experimental importer contract and Knowledge-managed execution, plus persisted binding, cursor, run and receipt state for the in-memory, PostgreSQL and LibSQL stores. Importers can update external-source pages in batches while retaining replay and repair bookkeeping.

Does a durable Mastra run guarantee exactly-once side effects?

No. Durable execution can resume work after interruption, but an interrupted step may run again if its completion was not saved. Integrations still need idempotent writes, stable source IDs and explicit handling for partial or refused records.

Sources & further reading

/* Comments */