Guide · Amazon Bedrock · Data Extraction
Amazon Bedrock Data Automation Blueprints — CreateBlueprintCommand, Schema Design, and DEVELOPMENT/LIVE Lifecycle
A Bedrock Data Automation blueprint defines a JSON schema that tells BDA exactly which fields to extract from each document — but the schema argument is a JSON string not a JSON object, blueprint DEVELOPMENT stage blueprints cannot be used in production invocations, and UpdateBlueprintCommand always overwrites the entire schema (not a partial patch). These three constraints are responsible for the majority of blueprint-related failures in production MCP server deployments. Beyond the schema string gotcha, four topics dominate blueprint lifecycle work: designing field schemas with accurate descriptions, the DEVELOPMENT → LIVE promotion workflow, version pinning in invocations using blueprintArn with explicit version, and the irreversible DeleteBlueprintCommand that destroys all versions. For the overall BDA async invocation pattern see BDA overview; for document-specific extraction patterns see BDA document processing; for output JSON structure see BDA output parsing.
TL;DR
Create blueprints with CreateBlueprintCommand from @aws-sdk/client-bedrock-data-automation (control-plane package). Set blueprintStage: 'DEVELOPMENT' for initial work. After testing, call CreateBlueprintVersionCommand to create an immutable LIVE snapshot. Always pin the blueprintVersion in production invocations — never use blueprintStage: 'DEVELOPMENT' for live traffic. The schema field is a JSON-serialized string: pass JSON.stringify(schemaObject), not the raw object.
What blueprints do — standard vs custom extraction
Without a blueprint, BDA applies standard extraction: it extracts all text, identifies tables and forms, generates summaries, and returns a structured JSON with generic document elements. Standard extraction works well for general document parsing where you want everything.
Blueprints are for domain-specific extraction — when you need specific named fields from documents of a known type. An invoice blueprint tells BDA to extract invoice_number, vendor_name, line_items, and total_amount. A medical note blueprint extracts diagnosis_codes, prescribed_medications, and follow_up_date. A contract blueprint pulls effective_date, termination_clause, and governing_law.
When you attach a blueprint to an invocation, BDA still performs its standard document understanding internally, but it additionally extracts the fields defined in your schema and returns them under a custom_output key alongside (or instead of) the standard output. The relationship between blueprint output and standard output depends on the standardOutputConfiguration you set in the blueprint or invocation — by default, standard output is included alongside custom fields.
Creating a blueprint — CreateBlueprintCommand
CreateBlueprintCommand lives in the control-plane package (@aws-sdk/client-bedrock-data-automation). The two required fields are blueprintName (unique per account+region) and type ('DOCUMENT' or 'IMAGE'). The schema field, also required, is a JSON string — you must call JSON.stringify() on your schema object before passing it in. Passing a raw object raises an immediate ValidationException.
import {
BedrockDataAutomationClient,
CreateBlueprintCommand,
type CreateBlueprintCommandInput,
} from '@aws-sdk/client-bedrock-data-automation';
const controlPlane = new BedrockDataAutomationClient({
region: process.env.AWS_REGION ?? 'us-east-1',
});
// Schema object — describes the fields BDA should extract
const invoiceSchema = {
description: 'Extract structured fields from vendor invoices',
type: 'object',
properties: {
invoice_number: {
type: 'string',
description: 'The unique invoice identifier or reference number on the invoice',
inferenceType: 'explicit', // field is explicitly stated in document
},
vendor_name: {
type: 'string',
description: 'The name of the company or individual issuing the invoice',
inferenceType: 'explicit',
},
invoice_date: {
type: 'string',
description: 'The date the invoice was issued, in ISO 8601 format (YYYY-MM-DD)',
inferenceType: 'explicit',
},
due_date: {
type: 'string',
description: 'Payment due date in ISO 8601 format; null if not specified',
inferenceType: 'explicit',
},
subtotal_amount: {
type: 'number',
description: 'Subtotal before taxes and fees, as a numeric value',
inferenceType: 'explicit',
},
tax_amount: {
type: 'number',
description: 'Total tax charged on the invoice; 0 if no tax line',
inferenceType: 'explicit',
},
total_amount: {
type: 'number',
description: 'Final total amount due including taxes and fees',
inferenceType: 'explicit',
},
currency: {
type: 'string',
description: 'Three-letter ISO 4217 currency code (e.g. USD, EUR, GBP)',
inferenceType: 'explicit',
},
line_items: {
type: 'array',
description: 'Individual line items on the invoice',
items: {
type: 'object',
properties: {
description: {
type: 'string',
description: 'Description of the product or service',
},
quantity: {
type: 'number',
description: 'Quantity ordered or hours worked',
},
unit_price: {
type: 'number',
description: 'Price per unit or hourly rate',
},
total: {
type: 'number',
description: 'Line item total (quantity × unit_price)',
},
},
},
},
payment_terms: {
type: 'string',
description: 'Payment terms stated on invoice (e.g. "Net 30", "Due on receipt")',
inferenceType: 'generative', // may need to be inferred from context
},
},
};
const input: CreateBlueprintCommandInput = {
blueprintName: 'invoice-extraction-v1',
type: 'DOCUMENT',
blueprintStage: 'DEVELOPMENT', // always start in DEVELOPMENT
schema: JSON.stringify(invoiceSchema), // MUST be JSON string, not object
clientToken: 'create-invoice-blueprint-v1', // idempotency token
};
const response = await controlPlane.send(new CreateBlueprintCommand(input));
const blueprint = response.blueprint!;
console.log(JSON.stringify({
blueprintArn: blueprint.blueprintArn,
blueprintName: blueprint.blueprintName,
type: blueprint.type,
blueprintStage: blueprint.blueprintStage, // "DEVELOPMENT"
creationTime: blueprint.creationTime,
}, null, 2));
The response blueprint.blueprintArn follows the pattern:
arn:aws:bedrock:REGION:ACCOUNT_ID:data-automation-blueprint/BLUEPRINT_ID
Persist this ARN — you need it for all subsequent operations (get, update, version creation, invocation attachment).
Schema design — inferenceType and field descriptions
The inferenceType field on each property controls how BDA extracts the value. 'explicit' means the value should be directly stated somewhere in the document. 'generative' means BDA may need to synthesize or infer the value from document context. When in doubt, start with 'explicit' — it produces more reliable, verifiable extractions and avoids hallucinated values for missing fields.
The description field is the most critical element of schema quality. BDA uses descriptions to match fields against document content — a vague description produces inconsistent extractions. Write descriptions that specify:
- What format the value should be in (ISO 8601, numeric not string, three-letter code)
- What to return when the field is missing (null, 0, empty string)
- Alternative phrasings or document labels the field might appear under
// Poor description — produces inconsistent results:
{ "invoice_number": { "type": "string", "description": "Invoice number" } }
// Better description — explicit format and fallback:
{
"invoice_number": {
"type": "string",
"description": "The unique invoice identifier. Usually labeled 'Invoice #', 'Invoice No.', 'Reference', or 'Bill Number'. Return null if no invoice number is found.",
"inferenceType": "explicit"
}
}
// Even better for numeric amounts — prevents string-vs-number type confusion:
{
"total_amount": {
"type": "number",
"description": "Total amount due as a numeric value without currency symbols, commas, or units. Example: 1250.00 not '$1,250.00'. Return 0 if the total cannot be determined.",
"inferenceType": "explicit"
}
}
Array schema design
For repeating structures like line items or entries in a table, use the array type with an items definition. BDA will extract all occurrences it finds in the document. For tables, BDA maps column headers to property names based on semantic similarity — column "Qty" maps to quantity, column "Unit $" maps to unit_price, and so on. The more specific your property descriptions, the better the column-to-field mapping.
const medicalNoteSchema = {
description: 'Extract structured clinical data from physician progress notes',
type: 'object',
properties: {
patient_id: { type: 'string', description: 'Patient MRN or identifier', inferenceType: 'explicit' },
visit_date: { type: 'string', description: 'Date of this clinical encounter in YYYY-MM-DD format', inferenceType: 'explicit' },
chief_complaint: { type: 'string', description: 'Primary reason for the visit as stated by the patient', inferenceType: 'explicit' },
diagnoses: {
type: 'array',
description: 'All diagnoses listed in the Assessment section',
items: {
type: 'object',
properties: {
code: { type: 'string', description: 'ICD-10 diagnosis code (e.g. J45.909)' },
description: { type: 'string', description: 'Plain text diagnosis description' },
},
},
},
medications_prescribed: {
type: 'array',
description: 'Medications newly prescribed or renewed at this visit',
items: {
type: 'object',
properties: {
name: { type: 'string', description: 'Medication name (generic or brand)' },
dosage: { type: 'string', description: 'Dose amount and unit (e.g. "500mg")' },
frequency: { type: 'string', description: 'Dosing frequency (e.g. "twice daily")' },
duration: { type: 'string', description: 'Duration of treatment (e.g. "10 days"); null if ongoing' },
},
},
},
follow_up_instructions: {
type: 'string',
description: 'Follow-up instructions or return visit timing from the Plan section',
inferenceType: 'generative', // often implicit in document
},
},
};
Updating blueprints — full replacement, not partial patch
UpdateBlueprintCommand replaces the entire blueprint schema. There is no partial update or JSON Merge Patch operation. If you call UpdateBlueprintCommand and omit a property that existed before, that property is deleted from the blueprint. Always read the current schema with GetBlueprintCommand first, merge your changes programmatically, then write the full updated schema back.
import {
BedrockDataAutomationClient,
GetBlueprintCommand,
UpdateBlueprintCommand,
} from '@aws-sdk/client-bedrock-data-automation';
async function addFieldToBlueprint(
controlPlane: BedrockDataAutomationClient,
blueprintArn: string,
newField: string,
fieldSchema: object,
): Promise<void> {
// 1. Read current schema — ALWAYS do this before updating
const getResp = await controlPlane.send(new GetBlueprintCommand({
blueprintArn,
blueprintStage: 'DEVELOPMENT', // UpdateBlueprintCommand targets DEVELOPMENT only
}));
const currentSchema = JSON.parse(getResp.blueprint!.schema!);
// 2. Merge new field into existing schema
currentSchema.properties = {
...currentSchema.properties,
[newField]: fieldSchema,
};
// 3. Write back the full updated schema
await controlPlane.send(new UpdateBlueprintCommand({
blueprintArn,
schema: JSON.stringify(currentSchema), // still must be JSON string
}));
console.log(`Added field '${newField}' to blueprint ${blueprintArn}`);
}
UpdateBlueprintCommand always targets the DEVELOPMENT stage — you cannot update a LIVE version. This mirrors the guardrails versioning model: immutable published versions, one mutable work-in-progress. If you need to change a production blueprint, update DEVELOPMENT, test, then create a new LIVE version.
Promoting to LIVE — CreateBlueprintVersionCommand
When a DEVELOPMENT blueprint is tested and ready for production, call CreateBlueprintVersionCommand to create an immutable snapshot at the LIVE stage. The returned blueprint object contains a blueprintVersion string (e.g. "1", "2"). Version numbers are strings, not integers — the same gotcha as Bedrock Guardrails versioning. Guard against accidental numeric comparison with a type check at startup.
import {
BedrockDataAutomationClient,
CreateBlueprintVersionCommand,
ListBlueprintsCommand,
} from '@aws-sdk/client-bedrock-data-automation';
async function promoteToLive(
controlPlane: BedrockDataAutomationClient,
blueprintArn: string,
description?: string,
): Promise<string> {
const response = await controlPlane.send(new CreateBlueprintVersionCommand({
blueprintArn,
clientToken: `promote-${blueprintArn.split('/').pop()}-${Date.now()}`,
}));
const promoted = response.blueprint!;
const version = promoted.blueprintVersion!;
// version is a string — guard against numeric comparison
if (typeof version !== 'string') {
throw new Error(`Unexpected: blueprintVersion is not a string: ${typeof version}`);
}
console.log(JSON.stringify({
event: 'blueprint_promoted_to_live',
blueprintArn: promoted.blueprintArn,
blueprintVersion: version, // e.g. "1" — string not number
blueprintStage: promoted.blueprintStage, // "LIVE"
}));
return version;
}
// List all LIVE versions of a blueprint for audit
async function listLiveVersions(
controlPlane: BedrockDataAutomationClient,
blueprintArn: string,
): Promise<string[]> {
const response = await controlPlane.send(new ListBlueprintsCommand({
blueprintArn,
blueprintStageFilter: 'LIVE',
resourceOwner: 'ACCOUNT',
}));
return (response.blueprints ?? []).map(b => b.blueprintVersion ?? 'unknown');
}
Using blueprints in invocations
Attach a blueprint to an invocation via the blueprintConfiguration.blueprints array in InvokeDataAutomationAsyncCommand. Always specify blueprintVersion explicitly in production — do not rely on blueprintStage: 'LIVE' alone, which picks up the most recently promoted version and silently changes behavior when you promote a new version.
import {
BedrockDataAutomationRuntimeClient,
InvokeDataAutomationAsyncCommand,
} from '@aws-sdk/client-bedrock-data-automation-runtime';
const runtime = new BedrockDataAutomationRuntimeClient({ region: process.env.AWS_REGION! });
// Read from env at startup — set when deploying a new blueprint version
const BLUEPRINT_ARN = process.env.BDA_BLUEPRINT_ARN!;
const BLUEPRINT_VERSION = process.env.BDA_BLUEPRINT_VERSION!; // e.g. "2" (string)
async function invokeWithBlueprint(inputS3Uri: string, jobId: string): Promise<string> {
const response = await runtime.send(new InvokeDataAutomationAsyncCommand({
inputConfiguration: { s3Uri: inputS3Uri },
outputConfiguration: { s3Uri: `s3://${process.env.OUTPUT_BUCKET}/output/${jobId}/` },
dataAutomationProfileArn: process.env.BDA_PROFILE_ARN!,
blueprintConfiguration: {
blueprints: [
{
blueprintArn: BLUEPRINT_ARN,
blueprintVersion: BLUEPRINT_VERSION, // pin to specific version
// Do NOT use blueprintStage: 'LIVE' in production —
// it picks up the latest promoted version without a deployment gate.
// blueprintStage: 'DEVELOPMENT' is blocked in non-dev invocations.
},
],
},
clientToken: `extract-${jobId}`,
}));
return response.invocationArn!;
}
The blueprints array accepts multiple blueprints for multi-document invocations. If you submit a zip archive containing multiple documents of different types, you can attach separate blueprints that BDA applies based on document type matching. For single-document invocations, the array will have one entry.
Retrieving and listing blueprints
GetBlueprintCommand returns the full blueprint including the schema field. You need to JSON.parse the schema string to inspect it programmatically.
import {
BedrockDataAutomationClient,
GetBlueprintCommand,
ListBlueprintsCommand,
} from '@aws-sdk/client-bedrock-data-automation';
async function inspectBlueprint(
controlPlane: BedrockDataAutomationClient,
blueprintArn: string,
version?: string,
): Promise<object> {
const response = await controlPlane.send(new GetBlueprintCommand({
blueprintArn,
blueprintVersion: version, // omit for DEVELOPMENT
blueprintStage: version ? 'LIVE' : 'DEVELOPMENT',
}));
const blueprint = response.blueprint!;
const schema = JSON.parse(blueprint.schema!); // schema is a string — must parse
console.log(`Blueprint: ${blueprint.blueprintName}`);
console.log(`Stage: ${blueprint.blueprintStage}`);
console.log(`Version: ${blueprint.blueprintVersion ?? 'DEVELOPMENT'}`);
console.log(`Fields: ${Object.keys(schema.properties ?? {}).join(', ')}`);
return schema;
}
// List all blueprints in account
async function listAllBlueprints(
controlPlane: BedrockDataAutomationClient,
): Promise<Array<{name: string, arn: string, stage: string}>> {
const results: Array<{name: string, arn: string, stage: string}> = [];
let nextToken: string | undefined;
do {
const response = await controlPlane.send(new ListBlueprintsCommand({
resourceOwner: 'ACCOUNT',
blueprintStageFilter: 'ALL',
maxResults: 100,
nextToken,
}));
for (const bp of response.blueprints ?? []) {
results.push({
name: bp.blueprintName ?? 'unknown',
arn: bp.blueprintArn ?? '',
stage: bp.blueprintStage ?? 'DEVELOPMENT',
});
}
nextToken = response.nextToken;
} while (nextToken);
return results;
}
DeleteBlueprintCommand — destructive, no recycle bin
DeleteBlueprintCommand deletes a blueprint and all of its versions. There is no two-step confirmation, no soft-delete, and no recycle bin. Once deleted, the blueprint ARN is permanently gone — any invocations that reference it will fail with a ClientError. Guard against accidental deletion by restricting the IAM action bedrock:DeleteBlueprint to deployment pipeline roles only, not application roles.
// IAM: restrict DeleteBlueprint to pipeline role only
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BDABlueprintApplicationAccess",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::ACCOUNT:role/mcp-server-task-role" },
"Action": [
"bedrock:GetBlueprint",
"bedrock:ListBlueprints"
// NO bedrock:DeleteBlueprint — application role cannot delete
],
"Resource": "*"
},
{
"Sid": "BDABlueprintDeploymentAccess",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::ACCOUNT:role/deploy-pipeline-role" },
"Action": [
"bedrock:CreateBlueprint",
"bedrock:UpdateBlueprint",
"bedrock:CreateBlueprintVersion",
"bedrock:DeleteBlueprint"
],
"Resource": "*"
}
]
}
Blueprint versioning strategy for MCP servers
A production-safe blueprint release workflow mirrors the Bedrock Guardrails approach: edit DEVELOPMENT, validate against a test corpus, promote to LIVE, update deployment config to pin the new version, deploy. Never update BDA_BLUEPRINT_VERSION in environment variables without first running your test corpus through the new version.
// Blueprint release script (run in CI/CD, not at runtime)
import {
BedrockDataAutomationClient,
CreateBlueprintVersionCommand,
GetBlueprintCommand,
} from '@aws-sdk/client-bedrock-data-automation';
async function releaseBlueprintVersion(
blueprintArn: string,
testCorpusDir: string,
): Promise<void> {
const controlPlane = new BedrockDataAutomationClient({ region: 'us-east-1' });
// 1. Confirm DEVELOPMENT schema is what you expect
const devBlueprint = await controlPlane.send(new GetBlueprintCommand({
blueprintArn,
blueprintStage: 'DEVELOPMENT',
}));
const schema = JSON.parse(devBlueprint.blueprint!.schema!);
console.log('DEVELOPMENT schema fields:', Object.keys(schema.properties ?? {}));
// 2. Run test corpus through DEVELOPMENT before promoting
// (call BDA with blueprintStage: 'DEVELOPMENT' on a sample set of documents)
await runTestCorpus(blueprintArn, testCorpusDir, 'DEVELOPMENT');
// 3. Promote to LIVE
const promoteResp = await controlPlane.send(new CreateBlueprintVersionCommand({
blueprintArn,
clientToken: `release-${Date.now()}`,
}));
const newVersion = promoteResp.blueprint!.blueprintVersion!;
console.log(`Blueprint promoted to LIVE version: ${newVersion}`);
// 4. Update SSM Parameter or deployment config with new version
// (update BDA_BLUEPRINT_VERSION in your deployment system)
console.log(`Update BDA_BLUEPRINT_VERSION to: ${newVersion}`);
}
Key gotchas
- Schema must be a JSON string. The
schemafield inCreateBlueprintCommandandUpdateBlueprintCommandis astring, not a JSON object. PassJSON.stringify(schemaObject). Passing a raw object raisesValidationException: schema must be a string. - DEVELOPMENT blueprints cannot be used in production invocations. Setting
blueprintStage: 'DEVELOPMENT'inblueprintConfiguration.blueprints[]works in development environments but is blocked for invocations using production profile ARNs. Always useblueprintVersion(the numeric string fromCreateBlueprintVersionCommand) for production traffic. - UpdateBlueprintCommand is a full replacement. There is no partial update. Omitting a property from the schema silently deletes that field from the blueprint. Always read the current schema first with
GetBlueprintCommand, merge your changes, then write back the entire schema. - blueprintVersion is a string not a number.
typeof response.blueprint.blueprintVersion === 'string'. Never compare it numerically (version > 1will not work as expected). Use string comparison or parse it as an integer explicitly (parseInt(version, 10)) when you need ordering. - Control-plane package for blueprints, runtime package for invocations.
CreateBlueprintCommand,UpdateBlueprintCommand, andCreateBlueprintVersionCommandall live in@aws-sdk/client-bedrock-data-automation.InvokeDataAutomationAsyncCommandandGetDataAutomationStatusCommandlive in@aws-sdk/client-bedrock-data-automation-runtime. Using the wrong client raisesUnknownOperation. - DeleteBlueprintCommand has no confirmation and no recycle bin. It deletes all versions immediately. Restrict
bedrock:DeleteBlueprintto deployment pipeline roles. Application and MCP server task roles should have onlyGetBlueprintandListBlueprints. - blueprintName must be unique per account+region. Creating two blueprints with the same name in the same region raises a conflict error. Use a versioning convention in the name (
invoice-extraction-v1,invoice-extraction-v2) to allow parallel development of incompatible schema changes without blocking the existing pipeline.