npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-synthea-api

v0.1.1

Published

Generate synthetic patient healthcare records as FHIR bundles with Synthea. Apify-backed n8n community node, pay-per-result, and usable as an AI agent tool.

Readme

n8n-nodes-synthea-api

An n8n community node that generates synthetic patient healthcare records as FHIR bundles using Synthea. It is backed by the Synthea Medical Record Generator API on Apify and bills per patient generated, so there are no subscriptions and no minimums.

Installation · Credentials · Operations · Output · Example workflows · Pricing · Resources

What it does

Set a population size and optional demographic and location filters, and the node generates realistic but entirely synthetic patient records. It returns one item per generated FHIR bundle, each with a Key-Value Store key you can use to retrieve the full bundle data. Because the data is synthetic, it carries no real-patient privacy risk, which makes it ideal for testing, demos, and training data. It also works as an AI Agent tool.

  • Generate 1 to 100 synthetic patients per run
  • Filter by gender, age range, US state, and city
  • Reproduce a run exactly with a random seed
  • Optionally apply the US Core R4 FHIR Implementation Guide
  • Choose how much data to return per bundle: Simplified, Raw, or Selected Fields

Installation

Follow the n8n community nodes installation guide:

  1. In n8n, open Settings > Community Nodes.
  2. Select Install.
  3. Enter n8n-nodes-synthea-api as the npm package name.
  4. Agree to the risks of using community nodes, then select Install.

After it installs, the Synthea Medical Records node appears in the nodes panel.

n8n Cloud only allows verified community nodes. Until this node is verified, install it on a self-hosted n8n instance.

Credentials

You need a free Apify account and an API token.

  1. Sign in to the Apify Console.
  2. Open Settings > Integrations and copy your Personal API token.
  3. In n8n, create a new Apify API credential and paste the token.
  4. Use the credential's Test button to confirm it works.

The node also supports Apify OAuth2 if you prefer to connect that way.

Operations

Patient > Generate generates synthetic patients and returns one item per FHIR bundle.

| Parameter | Description | | --- | --- | | Population Size | How many patients to generate (1 to 100). Required. | | Gender | Restrict to Male or Female. | | Age Range | Restrict to an age band, as minAge-maxAge. | | State / City | Restrict patient location. City requires a State. | | Reference Date | Generation reference date in YYYYMMDD. | | Random Seed | Reproduce the same patients across runs. | | Use US Core Implementation Guide | Apply US Core R4 FHIR profiles. | | Output | How much data to return: Simplified, Raw, or Selected Fields. |

Output

Each generated FHIR bundle is returned as its own n8n item. The full bundle data lives in the run's Apify Key-Value Store; each item carries the key_value_store_key you use to fetch it. The Output parameter lets you choose how much to return:

  • Simplified (default): a compact object with file, format, keyValueStoreKey, sizeMb, storedInKvStore, patientCount, and generationTimestamp. This mode is also used automatically when the node runs as an AI Agent tool, to keep responses small.
  • Raw: every field the API returns for each bundle, using the original field names below.
  • Selected Fields: pick exactly which fields to include.

Fields (Raw and Selected Fields)

| Field | Type | Description | | --- | --- | --- | | patient_count | integer | Number of patients in the generation run | | generation_timestamp | string | ISO 8601 timestamp of the run | | file | string | FHIR bundle file name | | path | string | Full path to the bundle file | | format | string | Bundle format, json or ndjson | | key_value_store_key | string | Key-Value Store key holding the full bundle data | | size_mb | number | Bundle size in megabytes | | stored_in_kv_store | boolean | Whether the bundle was stored successfully | | error | string | Error message if storage failed |

To retrieve a full bundle, read the Key-Value Store record for key_value_store_key from the Actor run, for example with the Apify node or an HTTP Request to the Apify Key-Value Store API.

Example workflows

1. Seed a test database

  1. Synthea Medical Records: Population Size 50.
  2. HTTP Request: fetch each key_value_store_key from the Key-Value Store.
  3. Postgres: insert each FHIR bundle into your test schema.

2. Generate a reproducible demo cohort

  1. Synthea Medical Records: Population Size 10, State Massachusetts, Random Seed 42.
  2. Code: transform the bundles into your demo format.

3. Build an age-specific sample

  1. Synthea Medical Records: Age Range 65-90, Gender Female.
  2. Filter: keep bundles where stored_in_kv_store is true, then process.

Pricing

This node calls the Synthea Medical Record Generator API on Apify, which is billed pay-per-patient plus a one-time setup fee per run, with no subscription and no minimums. Apify also includes a free monthly usage tier that covers typical volumes. See the Actor page for current rates.

Resources

License

MIT