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

# Set Custom Property

> Set or update a user custom property from an agent run.

<iframe src="http://localhost:3000/doc-comp-previews/agent-node-preview?type=set_org_user_custom_property" title="Agent Node Preview" width="100%" height="250px" className="border dark:border-[#1C1C20] rounded-xl" />

## How Set Custom Property works

Use this tool to write a value to a Flywheel user custom property during an agent run. This is useful when the agent determines something you want to persist, such as qualification status, risk level, lifecycle stage, or routing tags. The property update is applied immediately, making the new value available to downstream tools in the same run and to any future agent runs or segments that reference it.

## Configuration

<Columns cols={2}>
  <Card title="Inputs">
    <ParamField path="Prompt" type="string" required>
      Instructions describing when this tool should be used.
    </ParamField>

    <ParamField path="User" type="string" required>
      The target org user ID to update.
    </ParamField>

    <ParamField path="Custom Property" type="string" required>
      The custom property definition to update.
    </ParamField>

    <ParamField path="Value" type="string | number | boolean | object" required>
      The value to set. Type should match the selected custom property.
    </ParamField>
  </Card>

  <Card>
    <iframe src="http://localhost:3000/doc-comp-previews/agent-config-preview?type=set_org_user_custom_property" title="Agent Config Preview" width="100%" height="700px" className="" />
  </Card>
</Columns>

<Card title="Outputs">
  <ParamField path="success" type="boolean" required>
    Whether the update completed successfully.
  </ParamField>

  <ParamField path="org_user_id" type="string" required>
    The user ID whose property was updated.
  </ParamField>

  <ParamField path="property_name" type="string" required>
    The name of the custom property that was set.
  </ParamField>

  <ParamField path="previous_value" type="string | number | boolean | object">
    The value the property held before this update, if any.
  </ParamField>

  <ParamField path="new_value" type="string | number | boolean | object" required>
    The value that was written to the property.
  </ParamField>
</Card>

## Use Cases

**Health Score Tagging**

```
Condition: Trial user missing key activation events
Property: customer_health
Value: "at_risk"
Use: Flag users for proactive retention outreach
```

**Lifecycle Stage Progression**

```
Condition: Onboarding milestones completed
Property: lifecycle_stage
Value: "activated"
Use: Move user to the activated segment for upsell workflows
```

**Lead Qualification**

```
Condition: Agent completes qualification flow
Property: lead_score_bucket
Value: "high"
Use: Route high-intent leads to sales-assist agents or CSMs
```

**Routing Tag Assignment**

```
Condition: User matched to a specific product vertical
Property: routing_tag
Value: "enterprise_data"
Use: Ensure future agent runs and messages are tailored to the user's vertical
```

## Best Practices

**Property Design**

* Keep property definitions stable and strongly typed to avoid schema drift.
* Use clear, descriptive naming conventions so downstream reporting is easy to interpret.
* Define an expected set of values (e.g. enum-like strings) for properties used in segmentation.

**Write Discipline**

* Have the agent write derived values intentionally — not on every run unless a re-evaluation is required.
* Use conditions in the agent prompt to gate writes (e.g. only set `customer_health` when the score actually changes).
* Pair property updates with Find Event to base the written value on real activity data.

**Downstream Integration**

* Reference updated properties in subsequent tool calls within the same run for consistent decision-making.
* Use custom properties as segment criteria to trigger other workflows or broadcasts.
* Audit property change history to understand how agent-driven updates affect user journeys.
