> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Refs

> Reference objects that share lookup data across workflow executions.

Data Refs are named records that map one Refold Record ID to one or more External IDs from third-party integrations, so workflows can look up the same entity across systems between executions. Use them to unify a user, organization, or any other entity that exists under different IDs in Salesforce, HubSpot, Slack, and the other apps you connect.

Each [Linked Account](/v3/platform/concepts/linked-account) keeps its own Data Refs, even when names match across accounts, so one customer's mappings never leak into another's.

## How a Data Ref is shaped

A Data Ref is a named collection of records scoped to a single Linked Account. Each record links:

* **Record ID**: the canonical ID you create and own inside Refold. This is the key you control.
* **External IDs**: one or more IDs for that same entity inside connected integrations (for example, a Salesforce contact ID and a HubSpot contact ID for the same person).

A single Record ID can map to multiple External IDs across different integrations, which is how a Data Ref unifies an entity that lives in several systems at once.

<Frame>
  <img src="https://mintcdn.com/cobalt-55-abhishek/_hA6Vms9JiMZCzQC/images/Guides/Workflow/dataref.png?fit=max&auto=format&n=_hA6Vms9JiMZCzQC&q=85&s=e2cf666370b3bc720b7c5f99ab1f2df0" alt="A Data Ref named Users with Record IDs mapped to External IDs from multiple integrations" width="2880" height="1298" data-path="images/Guides/Workflow/dataref.png" />
</Frame>

<Note>
  Refold was previously branded as Cobalt. Some image assets and external links may still reference `gocobalt.io` while the migration completes.
</Note>

## Create a Data Ref

You don't need to create a Data Ref by hand before using it. The first time a workflow writes to a Data Ref that doesn't yet exist for the Linked Account, Refold creates it for you.

You can also browse, inspect, and manage Data Refs from the dashboard:

<Steps>
  <Step title="Open the dashboard">
    Go to **Settings** > [Data Refs](https://app.refold.ai/datarefs).
  </Step>

  <Step title="Review your refs">
    Each row shows the Data Ref **Name**, the **Associated Linked Account ID**, and the records inside it.
  </Step>

  <Step title="Filter by Linked Account">
    Use the Linked Account filter to scope the view to a single customer's refs. Refs with the same name on different Linked Accounts are independent.
  </Step>
</Steps>

## Read from a Data Ref

You read from a Data Ref inside a [workflow](/v3/platform/concepts/workflows/overview) by adding the Data Ref node and choosing one of the lookup actions. Reads work in both directions, so you can start from either side of the mapping.

<AccordionGroup>
  <Accordion title="Get Ref from Record ID">
    Looks up a Record ID and returns an array of every External ID associated with it across integrations. Use this when your workflow knows the canonical Refold ID and needs to find the matching IDs in connected apps.
  </Accordion>

  <Accordion title="Get Ref from External ID">
    Looks up an External ID from a specific integration and returns the Record ID it belongs to. Use this when an event arrives from a third-party app (for example, a webhook with a Salesforce contact ID) and you need to resolve it back to your canonical entity.
  </Accordion>
</AccordionGroup>

The values returned by these actions become available as variables on the node's output and can be referenced by downstream nodes the same way as any other workflow variable.

## Update a Data Ref

Writes are also performed from the Data Ref node. Three actions cover the lifecycle.

| Action                      | What it does                                                                 | Auto-create behavior                                                                              |
| --------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| **Create Ref**              | Adds a single record (Record ID plus its External ID mapping) to a Data Ref. | If the Data Ref doesn't exist for the Linked Account, Refold creates it and adds the record.      |
| **Create Bulk Refs**        | Adds many records to a Data Ref in a single call.                            | If the Data Ref doesn't exist for the Linked Account, Refold creates it and adds all the records. |
| **Delete Ref by Record ID** | Removes a record from a Data Ref using its Record ID.                        | No auto-create. The Data Ref must already exist.                                                  |

Each action runs against the Linked Account that the workflow is executing for, so writes from one customer's run never modify another customer's refs.

<Frame>
  <img src="https://mintcdn.com/cobalt-55-abhishek/_hA6Vms9JiMZCzQC/images/Guides/Workflow/dataref_Actions.png?fit=max&auto=format&n=_hA6Vms9JiMZCzQC&q=85&s=e17e613269bb8be707b086c912d40e8a" alt="The action picker for the Data Ref node listing all five available actions" width="2880" height="1618" data-path="images/Guides/Workflow/dataref_Actions.png" />
</Frame>

## When to use Data Refs

<CardGroup cols={2}>
  <Card title="Cross-integration ID lookup" icon="link">
    Resolve the same user, contact, or company across Salesforce, HubSpot, Slack, and other apps without rebuilding the mapping inside every workflow.
  </Card>

  <Card title="Cache lookup data" icon="database">
    Store the result of an expensive lookup (for example, the ID of a record you just created) and read it back on the next execution instead of querying the integration again.
  </Card>

  <Card title="Share config across workflows" icon="share-nodes">
    Maintain a single source of truth for IDs that multiple workflows need (welcome flow, sync flow, off-boarding flow) so updates propagate everywhere.
  </Card>

  <Card title="Accumulate counters and state" icon="chart-line">
    Track per-entity state between runs by keeping the canonical Record ID stable while updating its External ID mappings as new systems come online.
  </Card>
</CardGroup>

## Limits and behavior

<Note>
  Data Refs are scoped per Linked Account. Two Linked Accounts can both have a Data Ref named `Users` and the records inside them are completely separate.
</Note>

* **Per-account isolation.** Refs are never shared across Linked Accounts.
* **Auto-create on write.** `Create Ref` and `Create Bulk Refs` create the named Data Ref on the fly if it doesn't already exist for the Linked Account.
* **No auto-create on delete.** `Delete Ref by Record ID` requires the Data Ref to exist.
* **Stable Record IDs.** Record IDs are the keys you own. Keep them stable across writes so reads stay consistent.

## Examples

<AccordionGroup>
  <Accordion title="Resolve a Salesforce webhook back to a Refold user">
    1. A Salesforce webhook fires with `contactId = 003xx000004TmiQAAS`.
    2. Add a **Get Ref from External ID** action on a Data Ref named `Users`, passing the Salesforce contact ID as the External ID.
    3. The node returns the matching `Record ID`. Use it as the canonical key in every downstream node (logging, notifications, syncing to other apps).
  </Accordion>

  <Accordion title="Sync a new signup across multiple integrations">
    1. A user signs up in your product. You generate a Record ID (for example, your internal user UUID).
    2. As your workflow creates the matching entity in Salesforce, HubSpot, and Slack, add a **Create Ref** action after each create-step to record the new External ID against the same Record ID in the `Users` Data Ref.
    3. Later workflows can call **Get Ref from Record ID** to fetch the full list of External IDs in one call.
  </Accordion>

  <Accordion title="Bulk import an existing customer base">
    1. After a customer connects their Salesforce account, run a one-time backfill workflow that lists every contact.
    2. Use **Create Bulk Refs** to write all the Record ID + External ID pairs into a `Users` Data Ref in a single action instead of looping over Create Ref.
    3. If `Users` doesn't exist yet for this Linked Account, the bulk action creates it.
  </Accordion>

  <Accordion title="Off-board a deleted user">
    1. A delete event arrives for a Record ID.
    2. Call **Delete Ref by Record ID** on the `Users` Data Ref to remove the mapping so stale IDs aren't returned by future lookups.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Workflows overview" icon="diagram-project" href="/v3/platform/concepts/workflows/overview">
    Learn how workflow nodes pass data between steps and how Data Ref outputs are consumed downstream.
  </Card>

  <Card title="Linked Accounts" icon="user-plus" href="/v3/platform/concepts/linked-account">
    Understand the per-customer scope that Data Refs live inside.
  </Card>

  <Card title="Manage Data Refs" icon="gear" href="https://app.refold.ai/datarefs">
    Open the dashboard to inspect, filter, and edit your Data Refs.
  </Card>

  <Card title="Variables and references" icon="brackets-curly" href="/v3/platform/concepts/data-variables">
    See how to reference Data Ref outputs from later workflow nodes.
  </Card>
</CardGroup>
