Get the current step of a flow
Returns the current step of a flow without advancing it. Use it to render the step again after a page reload or a network error.
The flow endpoints are the runtime calls the login component
(<zitadel-login>) makes, step by step. createFlow (POST /flows) starts a flow, and
submitFlowStep (POST /flows/{flow_id}/submit) advances it.
For a sign-up step, prepares step.gates.signup_pow.challenge: one that
creates its user on submit, or one carrying a passkey registration that
creates its user.
Reuses challenges with more than a minute remaining; otherwise issues a
new one. If this render resolves parked SSO state, it first returns the
updated cookie; fetch the step again to obtain its puzzle.
The browser sends the flow's cookie, _zflow_{flow_id}, which
createFlow or the last submit set. A request without it, or whose
cookie holds another flow, answers 404 with flow.not_found.
Reuses the deployment sealed into the flow's cookie at createFlow; it
does not re-resolve from Origin. If that release was revoked since the attempt
started, the response is 409 with rel.revoked.
flow_id*stringFlow ID returned by POST /flows or the latest POST /flows/{flow_id}/submit.
Names the flow's encrypted cookie, _zflow_{flow_id}, which holds its
state; each flow in a browser has its own. May change between responses
when a flow pivot or pop occurs — always use the id from the latest response.
The current step. Only a render that resolved a parked SSO identity
sets the flow cookie; any other render leaves it unchanged. When that
render completed the sign-in, the step is terminal, the cookie is
cleared, and the step carries the handoff token, which the app
exchanges for a session at POST /sessions/exchange.
application/json- response
The state of a flow, with its handle, its session and the step to render.
id*stringFlow handle. Use this as the path parameter for subsequent
submit/event calls. May change between responses when a
flow pivot or pop occurs. Empty when a prompt=none request is
refused because no flow can start for it: nothing is left to submit.
session_id*stringUnderlying session ID. Stable across all stacked flows. Empty when a flow for an authorization request ends as it starts with a refusal, which no session is behind; the browser's live session when it ends with the code.
session_token?stringReserved for future rotation. The flow's sealed _zflow_{flow_id} cookie carries the flow state today.
step*The step the login component renders now. A step is one screen of a flow.
It holds ordered arrays of what to collect (fields), what the user can do
(actions), and which security checks must pass (gates). The LiquidJS template
in branding.liquid_template iterates these arrays in order and builds
name-keyed indexes locally for lookup.
branding?Resolved branding inherited from the app → team → project hierarchy. Determined at flow creation based on audience context. Does not change between steps.
client?The client whose authorization request the flow answers. Present on
every response of a flow started with auth_request_id, absent on
any other.
redirect_uri?stringPresent when step.complete is redirect.
urihandoff_token?stringShort-lived, audience-bound token produced on flow completion.
Exchange it for a session via POST /sessions/exchange.
Only present when step.complete is set.
handoff_token_expires_at?stringExpiry timestamp for handoff_token. Only present when
handoff_token is set.
date-timeimport { createZitadelApi, ZitadelClient } from "@zitadel/api/client";const api = createZitadelApi( new ZitadelClient({ baseUrl: process.env.ZITADEL_URL ?? "http://localhost:8080", }),);const flowStep = await api.getFlowStep("flow_01KWH8Q5NZT7F0N9WD3P2E4YM7");{ "id": "string", "session_id": "string", "session_token": "string", "step": { "name": "string", "texts": { "title_key": "string", "description_key": "string" }, "purpose": "login", "notice": "string", "error": "string", "complete": "redirect", "redirect_url": "http://example.com", "fields": [], "identifier": { "value": "string", "autocomplete": "string" }, "actions": [], "gates": {}, "sso_providers": [], "challenge": { "method": "passkey", "challenge_id": "string", "options": {} }, "consent": { "client": { "client_id": "string", "name": "string", "redirect_host": "string", "document_host": "string", "loopback": true }, "resource": "string", "scopes": [ { "name": "string", "group": "string", "access": "read", "selected": true, "text_key": "string" } ] } }, "branding": { "$schema": "string", "layout": "centered", "liquid_template": "string", "logo_url": "http://example.com", "hero_url": "http://example.com", "theme": { "mode": "light", "light": { "logo_url": "http://example.com", "palette": { "primary": "#4F46E5", "on_primary": "#4F46E5", "background": "#4F46E5", "surface": "#4F46E5", "muted": "#4F46E5", "border": "#4F46E5", "text": "#4F46E5", "text_muted": "#4F46E5", "link": "#4F46E5", "success": "#4F46E5", "warning": "#4F46E5", "error": "#4F46E5" } }, "dark": { "logo_url": "http://example.com", "palette": { "primary": "#4F46E5", "on_primary": "#4F46E5", "background": "#4F46E5", "surface": "#4F46E5", "muted": "#4F46E5", "border": "#4F46E5", "text": "#4F46E5", "text_muted": "#4F46E5", "link": "#4F46E5", "success": "#4F46E5", "warning": "#4F46E5", "error": "#4F46E5" } } }, "typography": { "font_family": "string", "font_url": "http://example.com", "scale": 0.75 }, "shape": { "radius": "none", "density": "compact", "logo_scale": 0.5 } }, "client": { "client_id": "string", "application_id": "string", "name": "string", "redirect_host": "string", "document_host": "string", "first_party": true }, "redirect_uri": "http://example.com", "handoff_token": "string", "handoff_token_expires_at": "2019-08-24T14:15:22Z"}Was this helpful?