A FHIR Bundle is a fundamental interoperability construct defined by the HL7 FHIR standard that acts as an envelope for collecting multiple discrete FHIR resources—such as Patient, Observation, or MedicationRequest—into a single atomic payload. The Bundle.type element explicitly defines the processing semantics, distinguishing between a searchset of results, a transaction requiring atomic processing of multiple operations, a document representing a signed clinical record, or a message for event-driven communication. This containerization is essential for federated learning architectures, as it allows a central aggregator to transmit a collection of updated model weights, provenance records, and consent directives as one coherent unit.
Glossary
FHIR Bundle

What is a FHIR Bundle?
A FHIR Bundle is a container resource that groups one or more FHIR resources into a single coherent unit for transmission, supporting distinct interaction types like search results, transactions, or documents.
Within a federated healthcare context, a transaction bundle is critical for orchestrating complex, multi-step operations across institutional boundaries, ensuring that a model update and its associated Provenance and Consent records are committed atomically. Each entry in the bundle contains a request method (e.g., POST, PUT) and a resource, enabling a server to execute a batch of RESTful interactions in a single round-trip. The Bundle.entry.fullUrl provides an absolute identity for each resource within the scope of the bundle, facilitating intra-bundle references and resolving dependencies between a newly created model artifact and its metadata before final persistence.
Core FHIR Bundle Types
A FHIR Bundle is a container resource that groups multiple resources into a single coherent unit for transmission, supporting distinct interaction patterns like search results, transactions, and clinical documents.
How a FHIR Bundle Works
A FHIR Bundle is a foundational interoperability mechanism that groups multiple independent resources into a single, transmittable unit with a defined interaction type.
A FHIR Bundle is a container resource that assembles a collection of other FHIR resources into a single coherent unit for transmission, enabling atomicity and context. It functions by wrapping resources like Patient, Observation, or MedicationRequest inside an entry array, where each entry holds a resource and a fullUrl for local referencing. The bundle's type attribute—such as searchset, transaction, or document—dictates the processing semantics, telling the receiving server exactly how to interpret the grouped data.
In a transaction bundle, all interactions within the batch must succeed or fail as a single atomic unit, preventing partial updates to a patient's record. A document bundle, conversely, packages a fixed, signed snapshot of clinical data, including a mandatory Composition resource that serves as the table of contents. This architecture allows disparate systems to exchange complex clinical contexts—like a discharge summary with associated labs and medications—without losing the relational integrity between the individual data points.
Frequently Asked Questions
A FHIR Bundle is a foundational container resource that groups multiple FHIR resources into a single, coherent unit for transmission. Understanding its interaction types is critical for architects designing federated learning pipelines that must extract, de-identify, and transport clinical data across institutional boundaries.
A FHIR Bundle is a container resource that packages a collection of other FHIR resources—such as Patient, Observation, or MedicationRequest—into a single atomic unit for transmission over a network. It serves as the primary envelope for almost all FHIR interactions, from querying a server to submitting a transaction. The Bundle resource itself contains a type element that defines the semantic purpose of the collection, a series of entry elements that hold the individual resources, and a link element that manages pagination and navigation. This structure allows a client to send or receive a complete clinical context—like a discharge summary containing a patient's demographics, lab results, and medication orders—in one HTTP request, resolving the stateless nature of RESTful APIs by providing a stateful wrapper.
Bundle vs. Transaction vs. Batch
A comparison of the distinct processing semantics for submitting collections of resources to a FHIR server, clarifying the critical differences in atomicity, dependency handling, and error isolation.
| Feature | Bundle | Transaction | Batch |
|---|---|---|---|
Primary Purpose | A general-purpose container for grouping resources | An atomic unit of work where all interactions succeed or fail together | A collection of independent interactions processed sequentially |
Atomicity Guarantee | |||
Dependency Handling | Not applicable; no processing semantics | Server resolves internal references and processes in dependency order | No dependency resolution; each entry is isolated |
Error Behavior | Not applicable; no processing semantics | If one interaction fails, the entire transaction is rolled back | Failure of one entry does not affect the processing of others |
Server Processing | None; a Bundle is a static artifact | All-or-nothing execution with rollback support | Independent execution of each entry as a separate operation |
Use Case | Search results, document packaging, message payloads | Submitting a patient record with linked observations and conditions | Bulk loading independent resources or sending multiple unrelated queries |
HTTP Verb for Submission | Not submitted for processing as a unit | POST to the root endpoint | POST to the root endpoint |
Bundle.type Code | collection, document, message, searchset | transaction | batch |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core FHIR resources and specifications that interact with or compose the Bundle resource for transmission, persistence, and transactional integrity.
Bundle Types and Interaction Patterns
A FHIR Bundle's behavior is defined by its type element, which dictates how the server must process the collection. Searchset bundles return paginated query results with link elements for navigation. Transaction bundles enforce atomicity—all entries succeed or fail as a unit, using conditional ifNoneExist logic to prevent duplicates. Batch bundles process entries independently, allowing partial success. Document bundles package a clinical document (e.g., a discharge summary) with a required Composition resource as the first entry, signed for integrity. Message bundles support event-driven messaging with a MessageHeader resource directing routing. Each type carries distinct processing semantics critical for federated learning pipelines where atomicity of model updates or patient data submissions must be guaranteed.
Provenance Resource
The Provenance resource establishes a chain of custody for data within a Bundle, tracking origin, authorship, and transformation history. In federated learning contexts, provenance is critical for auditing which institution contributed specific training data or model weights. Key elements include:
- target: The resource(s) this provenance record describes
- agent: Who or what was involved (practitioner, device, algorithm)
- activity: The action performed (create, update, transform)
- entity: Input or output data used in the process Provenance records embedded in Bundles enable verifiable audit trails across decentralized networks, supporting regulatory compliance and model lineage tracking.
FHIR Bulk Data Access
The Bulk Data Access specification defines an asynchronous API for exporting large, flat datasets as ndjson Bundles. Unlike synchronous searchset Bundles, bulk exports are designed for population-level analytics and machine learning training data preparation. The workflow:
- Client initiates an export via the
$exportoperation - Server returns a polling URL for status checks
- Upon completion, a Bundle of type
fileis returned containing download URLs - Each URL points to an ndjson file of homogeneous resources This mechanism is essential for federated learning architectures where local nodes must extract large, standardized datasets for local model training without overwhelming synchronous APIs.
FHIR Subscription
The Subscription resource enables real-time event-driven architectures by allowing clients to register interest in specific data changes. When a matching event occurs, the server delivers a notification Bundle to the designated endpoint. Subscription types include:
- rest-hook: Server POSTs a Bundle to a client URL
- websocket: Persistent connection for low-latency delivery
- email/sms: Simple notification channels In federated learning, Subscriptions can trigger model retraining workflows when new clinical data meeting specific criteria (e.g., new oncology cases matching mCODE profiles) becomes available, enabling continuous learning pipelines without polling.
StructureDefinition and Validation
A StructureDefinition resource defines constraints on how base FHIR resources are used within a specific context, forming the basis for Bundle validation. The FHIR Validator tool checks Bundles against these profiles, ensuring:
- Required elements are present
- Cardinality constraints are satisfied
- Value set bindings are respected
- Invariants (co-occurrence rules) are enforced For federated learning, strict validation ensures that data Bundles exchanged between institutions conform to agreed-upon profiles (e.g., US Core), preventing schema drift and ensuring model compatibility across heterogeneous EHR systems.
Bundle Entry Processing Rules
Each entry in a Bundle contains a request or response element governing HTTP-level semantics. The request.method determines the operation (POST for create, PUT for update, DELETE for remove), while request.url specifies the target endpoint. Conditional references using ifMatch and ifNoneMatch headers enable optimistic concurrency control. The fullUrl element provides an absolute identity for internal cross-referencing via Bundle.link resolution. Understanding these mechanics is essential for constructing valid transaction Bundles in federated systems where multiple institutions submit model updates or patient data simultaneously, requiring idempotent processing and conflict resolution.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us