---
id: SCR-PFM-QRY-004
title: Saved query workspace
route: '/console/{tenantId}/queries/{id}'
surface: console
product_area: platform
module: queries
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference:
  - IOP-PFM-QRY-001
source_sha:
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
purpose: >-
  Open a reusable question, supply runtime values and run, refine or manage it within the person’s
  powers.
supports:
  - JNY-PFM-QRY-002
  - CAP-PFM-QRY-006
  - CAP-PFM-QRY-007
  - CAP-PFM-QRY-014
  - CAP-PFM-QRY-015
  - CAP-PFM-QRY-003
permission: >-
  platform.saved-queries.read and the dataset’s own query key; writes need
  platform.saved-queries.use; sharing .share or .manage
entry_from:
  - Query library
  - schedule detail (the scheduled query)
  - report sources
exits_to:
  - schedule editor dialog (?dialog=new)
  - Query library
displays:
  - field: 'Stored definition, creator, audience, returned action powers and current validity problems.'
    source: getSavedQuery
  - field: Current result page using supplied values and allowed refinement.
    source: runSavedQuery
  - field: The source question’s visible delivery schedules.
    source: listQuerySchedules (filtered)
  - field: Requested file progress and completed download metadata.
    source: getQueryExport
actions:
  - label: Run
    operation_id: runSavedQuery
    permission: platform.saved-queries.read
    confirm: false
  - label: Save
    operation_id: updateSavedQuery
    permission: platform.saved-queries.use
    confirm: false
  - label: Save As
    operation_id: createSavedQuery
    permission: platform.saved-queries.use
    confirm: false
  - label: Share (visibility and roles)
    operation_id: updateSavedQuery
    permission: platform.saved-queries.share
    confirm: false
  - label: Delete
    operation_id: deleteSavedQuery
    permission: platform.saved-queries.use
    confirm: true
  - label: Export
    operation_id: startQueryExport
    permission: platform.queries.read
    confirm: false
  - label: Download
    operation_id: downloadQueryExport
    permission: platform.queries.read
    confirm: false
  - label: New Schedule
    operation_id: createQuerySchedule
    permission: platform.query-schedules.use
    confirm: false
  - label: Ask (refine with a written request)
    operation_id: generateDatasetQuery
    permission: platform.queries.generate
    confirm: false
states:
  - definition loading
  - missing or hidden question
  - read-only definition
  - runtime values required
  - definition problems
  - stale save conflict
  - dependent audience prevents narrowing
validation:
  - BR-CAP-PFM-QRY-006-04
  - BR-CAP-PFM-QRY-006-07
  - BR-CAP-PFM-QRY-006-08
  - BR-CAP-PFM-QRY-006-11
  - BR-CAP-PFM-QRY-006-13
  - BR-CAP-PFM-QRY-007-04
  - BR-CAP-PFM-QRY-007-05
  - BR-CAP-PFM-QRY-014-02
patterns:
  - Full layout
  - query builder
  - parameters panel
  - save dialog
  - 'save conflict dialog (Reload, never silently advance the version)'
  - narrowing refusal panel
  - export dialog
  - unsaved-changes guard
component: >-
  components/queries/query-workspace.tsx (PlatformSavedQuery), save-query-dialog.tsx,
  save-conflict-dialog.tsx, narrowing-refusal.tsx, export-dialog.tsx
evidence:
  - >-
    react-console at baf6dae: app/(console)/console/[tenantId]/queries/[id]/page.tsx;
    components/queries/*.tsx; components/queries/delivery/query-schedules-indicator.tsx
controls: [TC-AI-001, TC-AI-002, TC-AI-003, TC-AI-004, TC-AI-005, TC-AI-006, TC-AI-007, TC-AVL-001, TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-DAT-005, TC-DAT-006, TC-IAM-001, TC-IAM-002, TC-IAM-003, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-SEC-001, TC-SEC-002, TC-SEC-003, TC-SEC-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Saved query workspace

## What the Screen Is For

Open a reusable question, supply runtime values and run, refine or manage it within the person’s powers.

## What It Shows and Lets People Do

Running uses current dataset access. Saving replaces the existing question at the version read, while Save As creates another owned copy. Sharing, deletion, export and scheduling have separate gates. Written refinement returns another editable proposal through the drafting operation.

## States and Errors

A hidden private question appears missing. Invalid fields and required inputs stop execution with located feedback. Stale saves offer a fresh read; audience narrowing can name presentations that require wider source sharing.

## Patterns It Must Respect

The existing full query workspace uses parameter entry, save and conflict dialogs, narrowing feedback and export controls. Conflicts require deliberate reload rather than an unseen version advance.
