Skip to Content
DocumentationDataConceptsVariables and Parameters

Variables and Parameters

In How Data Flows, variables and parameters are runtime memory. The database is long-term storage.

VariablesParameters
PurposeStore statePass data across boundaries
FocusLifecycle and scopeInput/output contract

Variables

Client variable

  • Scope: All pages in the current client session
  • Lifecycle: App session — reset on close or refresh (Web)
  • Examples: global config, cached logged-in account, cross-page cart draft

Page variable

  • Scope: Current page only
  • Lifecycle: Created on enter, destroyed on leave
  • Examples: form staging, modal visibility, in-page search keyword

Actionflow variable

  • Scope: Current Actionflow run only
  • Lifecycle: Initialized at start, destroyed when the flow ends
  • Examples: loop totals, API payload staging

Parameters

Route and page parameters

  • Path parameters: part of the route (/product/:id) — structured, required, SEO-friendly
  • Query parameters: ?source=qr&page=2 — optional, tracking, filters
💡

URL example: https://momen.app/article/content/how-to-build-an-ai-bot?utm_source=google

  • Path: /article/content/how-to-build-an-ai-bot — path segment identifies the article
  • Query: ?utm_source=google — channel tracking, does not change core route

Custom component parameters

  • Inputs: parent → child (image, price into a card component)
  • Outputs: child → parent (e.g. product ID on “Add to cart”)

Logic parameters (Actionflow, API, AI)

  • Input parameters: data the caller must supply (order ID, prompt text)
  • Output parameters: results returned to the caller (total price, generated text, status code)

Selection matrix

ScenarioUseWhy
Persist logged-in identity app-wideClient variableGlobal reuse
Toggle modal on current pagePage variableAuto-destroy on leave
Accumulate values inside a flowActionflow variableBackend-local; don’t pollute page state
Open product detailPath parameterClean URL, SEO
Track QR campaign sourceQuery parameterAppend without changing route
Call API, AI, or ActionflowInput parameterStrong cross-boundary contract
Refresh UI from backend resultOutput parameterCapture black-box output

Last updated on