FabrikFabrik
FabrikQuery Builder

Saving and sharing

Persist queries to the server, organise them by category and tags, mark them as templates, and share them with the rest of the team.

A saved query is a canvas you can open again tomorrow. A shared query is a canvas your colleague can open today. This page is about both: the Save Query dialog, how permissions work, and the Load Query dialog that reads everything back.

Saved queries are also the input to scheduled runs, Time Machine snapshots, and validation-query wiring. Save first; automate later.

Saving a query

Open the canvas toolbar's three-dot menu and pick Save Query. The dialog covers everything you can attach to a query.

FieldNotes
Name (required)Minimum 3 characters. The title users see in the list.
DescriptionFree-form. Say what the query answers, not what it queries.
CategoryOptional — picked from the shared category list. Used for grouping in the Load dialog.
TagsType a word, press Enter or comma. Backspace on an empty input removes the last one. No fixed taxonomy — use what your team already uses.
Make this query publicSee Public vs private below.
Save as TemplateMarks the query as a reusable template. Only meaningful if it has variables.

The dialog also shows a Query Preview with the decoded APIC REST URL, so you have a last chance to sanity-check what's being saved.

Clicking Save Query creates a new record. If you're already editing a saved query, the button reads Update Query and writes back in place.

Save as Template

A template is a query whose variables are surfaced up front, so the next person to run it sees a configuration dialog instead of editing filters. Check Save as Template and the dialog enumerates every variable it detected in your filters — label, type, required/optional — so you can confirm before saving.

If you tick the template box but the query has no variables yet, the dialog flags it with an orange warning. Add variables via the wrench icon on a Filter node (see Variables), then re-save.

Public vs private

Fabrik has a simple three-way access model on each saved query.

AccessWho can see it
PrivateOnly the creator (and admins). Default for regular users.
PublicEvery authenticated user.
Admin-createdAutomatically public — admins' queries are meant as building blocks for the team.

The Make this query public checkbox is the knob you'll actually click. Admins don't need to check it — their queries are auto-public on create.

Under the hood there's also a shared_with field for per-user sharing; the backend enforces it on every query-list endpoint. For now the UI doesn't surface a "share with specific users" picker — private/public is the effective choice for most workflows.

Editing and deleting

  • Edit. Load a saved query, make changes, re-open Save Query. The dialog pre-fills with the existing metadata and the button becomes Update Query.
  • Delete. From the Load Query dialog, the delete action appears on each row you own. Only the owner or an admin can delete; everyone else just sees the query in read-only form.

Deleting a saved query also tears down anything hanging off it — scheduled tasks, validation-query wiring, Time Machine snapshot retention. The confirmation dialog lists what else will be removed, so you're not surprised.

Loading a query

Toolbar three-dot menu → Load Query / Template. The dialog is two things in one: a searchable list of saved queries and a templates-only filter.

Tabs: All, Queries, Templates. Templates isolate the is-template rows when you specifically want reusable patterns.

Search filters across name, description, category, and tags as you type — no pagination, no page reload.

Row information:

  • Name, description, category.
  • Tag badges.
  • Created-by user and timestamp.
  • Execution count and last-run time (for queries that have run).
  • A lock / globe icon indicating private / public.

Click a row to load it onto the canvas. Loading replaces the current canvas content — if you have unsaved changes, Fabrik prompts before overwriting.

Execution history

Running a saved query logs the run to its execution history. Toolbar three-dot menu → Execution History:

  • Who ran it, when.
  • Duration and row count.
  • Success / failure with error message.
  • A response preview for successful runs.

Unsaved canvas runs don't make it to the backend audit trail — only per-query history. Save first if you need the paper trail.

Versioning and Time Machine

Saved queries carry a version that bumps automatically when the canvas structure changes:

  • Major bump — structural changes (adding or removing nodes).
  • Minor bump — filter or post-processor changes.

The version string is what Time Machine snapshots are indexed against. A query's snapshot history is therefore version-aware: a drift comparison between a 2.0 snapshot and a 1.3 snapshot is flagged, because the schema shifted under the snapshots.

Time Machine needs a saved query ID to attach snapshots to, which is why the Output node's Time Machine toggle is disabled until you save.

Importing and exporting

Templates can be packaged as Template Bundles — a portable JSON artifact that another Fabrik instance can import. The bundle includes the query graph, variables, categories, and any sample data you want shipped with it. This is the recommended way to share queries across environments (dev → prod, tenant A → tenant B, customer → customer).

Template bundles live on the Library page rather than the Save dialog; see the Library section for the full flow.

Patterns that work

Team libraries. Admins create a core set of queries (common lookups, health checks, topology views). They're auto-public — the team picks them up in the Load dialog without extra steps.

Personal scratch. Save private drafts liberally. Private queries don't clutter anyone else's Load dialog and you can promote one to public later by re-saving with the checkbox on.

Templates for repeat work. When you find yourself editing one filter value every time, that's the signal: promote the value to a variable, tick Save as Template, share it. Future runs take a dialog prompt instead of a canvas edit.

Categories over tags. Categories are controlled (picked from a list) and tags are free-form. Use categories for the coarse axis (Tenant, Fabric, Interface, Security) and tags for the fine axis (audit, p1, east-dc, service-graph).

Troubleshooting

Save/load surprises that come up often:

  • "I can't save — button stays disabled." Name is under 3 characters, or empty. Fill the field.
  • "The Load dialog is missing a query I saved." You saved it as private with another account (check the creator column in the list), or it was saved under a different connection-scoped project in a multi-tenant deployment.
  • "I ticked 'Save as Template' but see an orange warning." The query has no variables. Add one with the wrench icon on a Filter node, then re-save.
  • "I can't delete a query I didn't create." Only the owner or an admin can delete a saved query. Ask an admin or the owner.
  • "The Output Time Machine toggle is disabled." Time Machine needs a saved query ID. Save the query first; the toggle activates immediately on reload.
  • "Editing a public query doesn't ask for confirmation." Public here means readable, not writable. Only the owner and admins can edit — other users see a read-only Load action.

Saved, shared, reusable. The next page — Scheduled queries — is about running them on a clock instead of clicking Run every time.