# FLOW-002: Flow Builder UI shows True/False instead of {null}

**Status: REPRODUCED** — Assignment node not rendered at all on canvas (worse than {null})

## Environment Setup

### Backend A — NexusCRM

1. Configure and start frontend:
   ```bash
   cd frontend
   echo "REACT_APP_BACKEND_URL=https://nexuscrm.pingcap.com" > .env
   npm run dev  # starts on localhost:5173
   ```

2. Get a JWT token:
   ```bash
   curl -s -X POST "https://nexuscrm.pingcap.com/services/oauth2/token" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "grant_type=client_credentials&client_id=test-gosf-client&client_secret=test-gosf-secret-123" \
     | python3 -c "import sys,json; print(json.load(sys.stdin).get('access_token',''))"
   ```

3. Login via JavaScript console:
   ```javascript
   localStorage.setItem('auth_token', '<JWT token from step 2>');
   localStorage.setItem('instance_url', 'https://nexuscrm.pingcap.com');
   location.reload();
   ```

### Backend B — Salesforce (via Vite proxy)

1. Configure and start frontend:
   ```bash
   cd frontend
   echo "REACT_APP_BACKEND_URL=https://pingcap--partialcop.sandbox.my.salesforce.com" > .env
   npm run dev  # starts on localhost:5173
   ```

2. Login via Backend mode → Advanced Options → Token:
   - Token: `00D...` (valid SF session token)
   - **CRITICAL**: instance_url must be `http://localhost:5173` (NOT the SF URL).
     This forces all API requests through the Vite proxy, bypassing CORS.
   - Click Login

## Steps (verified 2026-03-25)

1. Navigate to `http://localhost:5173/setup/flows`
2. Search for "BoolTest" in the search box — 13 results appear
3. Scroll right to see the ACTIONS column
4. Click the edit button (pencil icon) on any BoolTest flow
5. Flow Builder loads with the flow canvas

## Actual Result (NexusCRM backend)

- Flow Builder opens successfully (title shows "BoolTest..." + "Active")
- Canvas shows: Start → Record-Triggered Flow → Run Immediately → END
- **Assignment node ("SetBoolean") is completely missing from the canvas**
- The assignment that sets `$GlobalConstant.True` to `OutputBool` is not rendered
- Users cannot see or edit the boolean assignment at all

## Expected Result (Salesforce backend — verified)

- Flow Builder opens with full canvas including all nodes
- Assignment nodes are visible and clickable
- Boolean values display as `True` (pill control) or `{!$GlobalConstant.True}`

## A/B Comparison

| Aspect | SF Backend | NexusCRM Backend |
|--------|-----------|-----------------|
| Flow Builder loads | YES | YES |
| Assignment node visible | Expected YES | **NO — missing** |
| Canvas complete | Expected YES | **NO — only Start/End** |

## Root Cause

The flow metadata created via API contains assignment data (verified by DATA-008 API test —
the `elementReference: "$GlobalConstant.True"` value is stored and retrievable). However,
the Flow Builder canvas renderer does not create visual nodes for assignments that were
added via API without canvas position metadata (x/y coordinates, connector references).

## Failure Indicators

- Assignment node not visible on canvas (current state — worse than {null})
- Assignment Value field shows `{null}` (PDF-described state)
- Assignment Value field shows `[object Object]`
- Assignment Value field is empty/blank

## Related

- FLOW-001 (API): Confirmed `$GlobalConstant.True` returned as unresolved reference
- DATA-008 (API): Confirmed value is preserved in storage (not lost)
