AWS1 input → 2 outputs
DynamoDB Update
Updates specific attributes of an existing DynamoDB item without overwriting the entire record. Perfect for refreshing OAuth tokens or incrementing counters.
Inputs
Outputs
Output 1 — Success Output 2 — ErrorHow to Use
- Select an AWS config node and enter the Table Name.
- Set the Partition Key (and Sort Key if your table has one).
- Choose Simple Mode to use the visual field builder, or Advanced Mode for raw DynamoDB expressions.
- In Simple Mode, click Add Field and choose the action: SET, REMOVE, ADD, DELETE.
- Set Return Values to
ALL_NEWto get the full updated item on output 1.
Update Actions (Simple Mode)
Examples
Refresh an OAuth access token for an Epic integration — atomically update the token and increment a refresh counter:
// Simple Mode: add these rows:
// Field: accessToken | Action: SET | Value: eyJhbGci...
// Field: expiresAt | Action: SET | Value: 1714000000
// Field: refreshCount | Action: ADD | Value: 1
// Or use runtime override:
msg.payload = {
key: { id: "epic-hospital-A", sk: "oauth_token" },
updateExpression: "SET #at = :token, #exp = :expires ADD #rc :one",
expressionAttributeNames: {
"#at": "accessToken", "#exp": "expiresAt", "#rc": "refreshCount"
},
expressionAttributeValues: {
":token": "eyJhbGci...", ":expires": 1714000000, ":one": 1
},
returnValues: "ALL_NEW"
};
Best Practices
- Use ADD for counters and numeric increments — it is atomic and safe for concurrent updates.
- Set Return Values to ALL_NEW for token updates so you can verify the new value was saved.
- Use conditionExpression with
attribute_exists(id)to ensure you only update items that actually exist. - Prefer Update over Put for partial changes — Put overwrites the entire item and can delete attributes you didn't intend to change.