AWS1 input → 2 outputs
DynamoDB Create
Inserts or replaces an item in a DynamoDB table. Used in ConnectHealth to store OAuth tokens, session data, FHIR resource cache, and audit logs.
Inputs
Outputs
Output 1 — Success Output 2 — ErrorHow to Use
- Select an AWS config node and enter the Table Name.
- Choose Item Source: wire a previous node's output (
msg.payload) or paste a static Inline JSON object. - Make sure the item object includes all key attributes — both partition key and sort key if your table has one.
- Add a Condition (like Safe insert) if you want to prevent overwriting existing data.
- Wire Output 2 to catch AWS errors (wrong table, condition failed, auth failure).
Item Requirements
The item you provide must include the table's full primary key. If your table has both
a partition key (id) and a sort key (sk), both attributes must be present
in the item object. Missing a key attribute results in a ValidationException.
Warning: Create completely replaces an existing item with the same key. Any attributes not in your new object are silently deleted. Use DynamoDB Update to change only specific fields.
Examples
Store a new Epic OAuth token after a successful authentication, with a safe insert condition:
msg.payload = {
item: {
id: "epic-hospital-A",
sk: "oauth_token",
accessToken: "eyJhbGci...",
refreshToken: "dGhpcyBp...",
expiresAt: 1714000000,
scope: "patient/*.read",
storedAt: Date.now()
}
};
// ConditionMode = "Safe insert"
Best Practices
- Always include
storedAt: Date.now()so you have an audit trail of when the item was written. - Use the Safe insert condition when initializing tokens to prevent race conditions.
- Use DynamoDB Update instead of Create when you want to refresh tokens — Create silently deletes attributes you omit.