UnpackObject 1.0.0¶
Overview¶
Description¶
Takes in an object and sends each key-value pair to the corresponding output
Configuration Options¶
No configuration options available.
Inputs¶
| Name | Data Type | Description |
|---|---|---|
| object | dict[str, Any] | The dictionary object to unpack. Each key-value pair will be sent to corresponding output connections. |
Outputs¶
| Name | Data Type | Description |
|---|---|---|
| properties | dict[str, Any] | Dynamic outputs created for each key in the input object. Output names must match the keys in the input dictionary. |
Examples¶
# Unpack a simple user object
blocks:
- name: unpack_user
type: UnpackObject
inputs:
object:
id: "user_12345"
name: "Alice Johnson"
email: "alice@company.com"
role: "admin"
active: true
outputs:
- name: id
connection: user_id_processor
- name: email
connection: email_validator
- name: role
connection: permission_checker
Error Handling¶
Missing Output Connection
- Error Code
ConnectionError- Common Cause
- Input object contains keys that don't have corresponding output connections defined
- Solution
- Ensure all expected object keys have matching output connections, or filter the input object to only include keys with defined outputs
Invalid Input Type
- Error Code
TypeError- Common Cause
- Input is not a dictionary object (e.g., string, list, or null value)
- Solution
- Ensure the input is a valid dictionary object. Use ParseJson block if starting with a JSON string
FAQ¶
How do output connections work with dynamic keys?
Output connections must be defined with names that exactly match the keys in your input object. If your object has keys "name", "email", and "role", you need three output connections with those exact names. Keys without matching outputs will be ignored.
Can I unpack nested objects?
UnpackObject sends the complete value for each key, including nested objects and arrays. If you need to unpack nested structures further, chain additional UnpackObject blocks or use specific extraction blocks for the nested data.
What happens if the input object is empty?
An empty object {} will result in no outputs being sent. This is normal behavior and won't cause errors. Downstream blocks should handle cases where they might not receive input.
How do I handle objects with unknown or variable keys?
For objects with dynamic keys, consider using GetKeys block first to identify available keys, then configure your workflow accordingly. Alternatively, use Get block with JSONPath expressions to extract specific values without knowing all keys upfront.