<@U04UQ68083H> What is flow ? Explain everything a...
# ory-copilot
q
@chilly-king-10285 What is flow ? Explain everything about it
c
A message from kapa.ai
In the context of Ory, a flow is an important element of Ory's self-service APIs. It is used to accomplish a variety of goals such as user login, user logout, user registration, changing account settings, account verification, and account recovery. Flows are standardized, meaning they run the same basic operations, regardless of which specific flow is integrated. The self-service API is split to integrate with two types of applications - browser and native. The reason for the API split is the security measures necessary for the different application types. For example, the API sets a CSRF cookie for browser applications. For native applications, CSRF cookie isn't required and isn't set. A flow in Ory consists of five operations: 1. Creating the flow for the specific goal and application type, for example user login in a native app. 2. Using the flow data to render the UI. 3. Submitting the flow with user data, such as username and password. 4. Potentially handling errors, such as invalid user input and going back to step 2. 5. Handling the successful submission. Flows can consist of multiple methods. For example, a login flow can have the
password
and
oidc
methods. Flows can be completed by only one method at a time. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#flows).
q
@chilly-king-10285 Does the flow parameter change every time for a specific method or does it remain the same
c
A message from kapa.ai
The
flow
parameter is unique for each instance of a specific method. It does not remain the same for every execution of the method. For example, in the context of the
updateLoginFlow
or
updateSettingsFlow
methods, the
flow
parameter represents the Login Flow ID or Settings Flow ID respectively. The value for this parameter comes from the
flow
URL Query parameter sent to your application (e.g.
/login?flow=abcde
or
/settings?flow=abcde
). Each time a new login or settings flow is initiated, a new unique
flow
ID is generated and used. This ensures that each flow instance is properly tracked and managed. You can refer to the [Ory API Reference](https://www.ory.sh/docs/reference/api) for more details.
q
@chilly-king-10285 Can I manually set the flow to any value I want ?
c
A message from kapa.ai
No, you cannot manually set the
flow
to any value you want. The
flow
ID is generated by the Ory system when a new flow (like a login or settings flow) is initiated. This ID is used to track and manage the specific instance of the flow. The value for the
flow
parameter comes from the
flow
URL Query parameter sent to your application (e.g.
/login?flow=abcde
or
/settings?flow=abcde
). Each time a new flow is initiated, a new unique
flow
ID is generated. You can refer to the [Ory API Reference](https://www.ory.sh/docs/reference/api) for more details.
q
@chilly-king-10285 Thanks
c
A message from kapa.ai
You're welcome! If you have any more questions about Ory or anything else, feel free to ask. Happy to help!