Skip to main content

Create Custom Data Object

Create a focused custom object by selecting, renaming, and reshaping available workflow data. Use this action when an earlier step creates or retrieves a large object, but later steps only need a clear subset of that data.

For example, an outside API call might return a large response with many nested fields. This action can keep only the fields your workflow needs, rename them, and organize them into a cleaner object before you store the result or pass it to another action.

When to Use This Action

Use this action when you need to bring focus to the important parts of complex data:

  • Simplify a large response from a third-party API.
  • Remove unrelated fields before storing action results.
  • Prepare a clean return object from a reusable macro.
  • Reduce the data sent into an agentic action so the AI request only receives relevant context.
  • Rename vague API fields into clearer names for later workflow steps.
  • Reshape nested arrays or objects into a structure that better matches the next action.

Do not use this action when the next step already accepts the source object as-is, or when you only need to store one simple text or number value. In those cases, a variable-setting action may be simpler.

Common Use Cases

Simplify an API Response

Remote APIs often return more data than a workflow needs. After an API call retrieves a large object, add this action to create a smaller result object with only the fields that matter.

For example, a vendor API might return account details, billing data, status metadata, related users, timestamps, links, and internal IDs. If your workflow only needs the account name, subscription status, and renewal date, use this action to keep those fields and discard the rest from the object you pass forward.

Shape Macro Output

Macros work best when they return a clean and predictable result. A macro can retrieve or calculate a complex object, then use this action near the end of the macro to reshape the final output.

This pattern lets the macro expose only the data that callers need. The macro can still perform complex lookups internally, but it does not need to return every unrelated field from the original request or API response.

Prepare Data for Agentic Actions

Agentic actions perform better when the AI request receives focused context. If a workflow retrieves a large, nested, or noisy object before an agentic action, use this action first to clarify the data.

You can rename fields, remove unrelated data, and organize the object around the task the agentic action needs to complete. This reduces context size, helps control AI cost, and makes the request easier for the model to understand.

Parameters

Source Data

Choose the parent data object to reshape. Leave this blank to use all available workflow data.

Examples:

  • email to reshape the incoming email data
  • custom.QueryResult to reshape data returned by a previous action
  • Blank to reshape from all available data

Custom Object Shape

Choose fields in the builder or write a shape expression directly. The action stores the resulting custom object in the configured result variable.

The editor saves Builder selections and Advanced Expression text separately. If you use Builder, the same selected checkboxes appear when you edit the action later. If you use Advanced Expression, the action opens in Advanced Expression mode when you edit it later.

Switching from Builder to Advanced Expression keeps the generated expression available for editing. Switching from Advanced Expression back to Builder can replace custom expression changes with the saved Builder selections, so the console asks for confirmation before it clears the advanced expression.

Example shape expression:

{
email: {
to: email.to[].{
address: address
}
}
}

This keeps only the recipient address from each email recipient.

How It Works

  1. Choose the source object that contains the data you want to simplify.
  2. Select fields in Builder mode, or write an Advanced Expression to rename and reshape fields.
  3. Review the preview output to confirm the new object shape.
  4. Store the action result in a variable.
  5. Use that cleaner variable in later actions, macro output, API calls, or agentic actions.

Returned Variables

If you configure the Store the results in Variable option for this action, that variable contains the custom object created by the shape expression.

For example, storing results in CleanEmailData makes the object available as {{custom.CleanEmailData}} in later actions.

FAQs

Does this action change the original data?

No. The action creates a new custom object. It does not modify the original source data.

Why use this before an agentic action?

Agentic actions should receive only the information relevant to the request. A smaller and clearer object reduces noise, lowers context size, and helps the AI model focus on the task.

Why use this inside a macro?

Use it near the end of a macro to control what the macro returns. The macro can retrieve complex data internally, then return only the useful result fields to the workflow that called it.