AWS1 input → 2 outputs
DynamoDB Get
Retrieves a single item from a DynamoDB table by its exact primary key.
Inputs
Outputs
Output 1 — Success Output 2 — ErrorHow to Use
- Select an AWS config node (or create one with your AWS credentials).
- Enter the Table Name.
- Set the Partition Key name and value (e.g. name:
id, value:epic-hospital-A). - If your table has a Sort Key, fill in the Sort Key name and value too — it is mandatory for composite-key tables.
- Wire the output: Output 1 = success (check
msg.payload.found), Output 2 = AWS error.
Primary Key
DynamoDB identifies items by their primary key. If your table was created with both a
partition key (id) and a sort key (sk), you must supply both.
Omitting the sort key from a composite-key table will result in a validation error.
You can override the key entirely at runtime by setting msg.payload.key to
a full key object, e.g. { id: "epic-A", sk: "oauth_token" }.
ConnectHealth Example
Retrieve an Epic OAuth token stored in DynamoDB for a hospital integration:
// Set in the node config:
Partition Key Name: id
Partition Key Value: epic-hospital-A
Sort Key Name: sk
Sort Key Value: oauth_token
// Or override at runtime:
msg.payload = {
key: { id: "epic-hospital-A", sk: "oauth_token" }
};
// Output 1 when found:
msg.payload = {
found: true,
item: {
id: "epic-hospital-A",
sk: "oauth_token",
accessToken: "eyJhbGci...",
expiresAt: 1714000000
}
}
Best Practices
- Enable Consistent Read when retrieving tokens before making an API call — ensures you always read the latest written value.
- Always check
msg.payload.foundbefore accessingmsg.payload.item. Iffoundisfalse,itemisnull. - Use Output 2 to wire an error-handling branch (e.g. log the error and send a notification).
- For retrieving many items at once, use DynamoDB Batch (BatchGet) instead.