Your first flow
For AI agents: this page is Markdown at https://squiggle.sh/docs/first-flow.md. Every docs page is listed at https://squiggle.sh/llms.txt, and all of them are one file at https://squiggle.sh/llms-full.txt.
Run the flow squiggle init wrote, then record a sign-in journey, turn it into a flow and make it check that the sign-in worked. You need a set-up app running in the simulator.
If you haven’t set up your app yet, start with Set up your app.
Run the smoke flow
init wrote .squiggle/flows/smoke.yaml. It waits for the app to settle and checks that the screen isn’t blank (visual: [noBlankFrame]). Run it by name:
squiggle flow smokeYou see each step as it runs, then PASS or FAIL. If it fails, the output names the step and saves a screenshot of the simulator under the failing step.
Record a journey
Writing a flow from a blank file is slow. Instead, use the app while Squiggle records, and let it draft the flow:
squiggle record login# use the app: sign in as you normally would, then press Ctrl-CThis saves .squiggle/recordings/login.sqrec. Turn it into a flow:
squiggle flow --from-recording .squiggle/recordings/login.sqrec -o .squiggle/flows/login.yamlThe draft lists each tap and screen change. When a tap hit something with no testID or label, the draft says so. Add a testID to those controls in your code, so the flow can find them again after the layout changes.
You can also record in Studio, from the Flows screen:
Make it check something
A recording shows what you did, not what should happen. Until you add an assert, the flow passes as long as each tap is sent, even if sign-in is broken. Add one at the end, for something you only see after a successful sign-in:
flow: loginsteps: - type: { into: { testID: email-input }, value: dana@example.com } - type: { into: { testID: password-input }, value: correct-horse } - tap: { text: Sign in } - assert: { visible: { text: "Welcome back, Dana" } }Run it:
squiggle flow loginRun it in Studio
Studio lists the flows in .squiggle/flows/, runs them on the simulator you’re watching, and shows each step’s result beside the screen. Studio is the Mac app; if you installed only the squiggle command, get Studio here:
Next
Run the flow again every time you save a file in your app:
squiggle watch login- Writing flows: selectors, every step and the asserts you can write.
- Agentic flows: write a step as a goal and let your coding agent work out the taps.