All posts

Turn Plain‑Language Descriptions into Automated Flows with Phoma’s AI Integration

Turn Plain‑Language Descriptions into Automated Flows with Phoma’s AI Integration

Introduction

Automating repetitive actions on Android devices used to require writing scripts or learning complex tools. With Phoma, you can now describe a task in everyday language and let an AI agent build a visual flow for you. This approach lowers the barrier for QA testers, developers, and operations staff who need quick, reliable automation without coding.

Why does this matter? Many professionals think they need programming skills to automate UI interactions, but the reality is that most tasks can be expressed in plain sentences. By leveraging Phoma’s built‑in AI integration, you can capture intent quickly, let the AI translate it into a step‑by‑step visual diagram, and then run the flow on a single phone or across a fleet. The result is faster onboarding, fewer errors, and more time for higher‑value work.

Why Use AI to Generate Flows?

  • Speed: Writing a prompt takes seconds, whereas building a flow manually can take minutes.
  • Accessibility: Team members without coding experience can contribute to automation.
  • Consistency: The AI follows best practices for selectors and timing, reducing flaky tests.
  • Iterative refinement: If the generated flow is off, you can edit it directly in Phoma, preserving the intent while correcting the details.

Connecting Your Phone to Phoma

Before the AI can act on a device, Phoma needs a connection. Follow these steps for a reliable setup.

USB Debugging

  1. Enable Developer Options on the Android device (Settings > About Phone > Build Number tap 7 times).
  2. In Developer Options, toggle USB Debugging on.
  3. Connect the phone to your Windows PC with a USB cable.
  4. On the PC, launch Phoma and select Devices > Add Device. Phoma will detect the phone and prompt you to confirm the debugging certificate.

Wireless (ADB over Network)

  1. Ensure phone and PC are on the same Wi‑Fi network.
  2. Enable USB Debugging first (same as above).
  3. Run adb tcpip 5555 in a command prompt on the PC.
  4. Disconnect the USB cable, then run adb connect <phone_IP>:5555.
  5. In Phoma, the device will appear as a wireless entry. Click Pair and confirm the prompt on the phone.

Tip: If the phone refuses to connect, restart both devices, verify firewall rules, and double‑check that the driver for your manufacturer is installed.

Preparing the Plain‑Language Prompt

The quality of the generated flow depends on how clearly you describe the task. Use the following structure:

  1. Goal verb – what you want to happen (e.g., "log in", "enter data", "take a screenshot").
  2. Target app – the package name or recognizable app name.
  3. Context details – UI elements, data values, and any conditions.
  4. Optional constraints – wait times, loops, error handling.

Example Prompt

Log in to the MyBank app using the email "user@example.com" and password "SecurePass123". Tap the "Sign In" button after entering credentials. If login fails, wait 2 seconds and retry once.

Why this works: The sentence includes the action (log in), the app (MyBank), the data (email/password), and a conditional retry. The AI can map each clause to a UI Automator step.

Using Phoma’s AI Agent

Once you have a prompt, Phoma’s AI runs in the background and returns a visual flow diagram. Here’s how to invoke it:

  1. Click Create New Flow in the Phoma dashboard.
  2. Choose AI Assisted from the template list.
  3. Paste your prompt into the AI prompt box and click Generate.
  4. Phoma displays a preview of the flow with each step as a node (tap, type, wait, etc.).

Reviewing the Generated Flow

  • Inspect selectors: Hover over a step to see the element’s accessibility ID or resource‑id. If the selector is fragile (e.g., based on text that changes), replace it with a more stable one.
  • Adjust timing: Add a Wait node where needed, or increase the default wait duration.
  • Add conditions: Use If nodes for success/failure branches.

Real‑world example: After generating a flow to capture public product listings from an e‑commerce app, the AI selected the element by its text label "Product Name". Because the app frequently updates the label to "Item Name", you edit the selector to target the resource‑id com.shop.app:id/product_title instead.

Editing the Flow Manually

Even the best AI can miss edge cases. Phoma’s editor lets you fine‑tune the flow without rewriting code:

  • Add steps: Drag a Tap, Type, or Swipe node from the palette and drop it where needed.
  • Remove steps: Select a node and press Delete.
  • Connect nodes: Click the start node, drag a line to the destination node.
  • Set properties: Double‑click a node to edit its parameters (e.g., text to type, key codes, element wait).

Tip: Use the Preview mode to simulate the flow on a single device before deploying it across multiple phones.

Running the Flow on One or Many Phones

Once satisfied, you can execute the flow:

  1. Single device: In the flow editor, click Run and select the connected phone from the device list.
  2. Multiple devices: Choose Run on All Devices (or use the Batch Run option). Phoma will start the same sequence on each phone sequentially, logging results separately.

Scheduling Runs

  • Open Automations > Scheduled Runs.
  • Click Add Schedule, pick the flow, and set a recurrence (daily, weekly, custom cron).
  • Enable Run while app is open to keep the phone’s screen on during execution.

Why schedule? It ensures regression checks happen automatically each build, reducing manual oversight.

Sharing Phones and Flows Inside a Team

Phoma’s Team plan introduces shared device pools and collaborative flows:

  • Shared devices: Admins can grant access to specific phones so any team member can run flows without needing physical access.
  • Team flows: Create a flow in Team Library, add comments, and let others edit or version‑control it.
  • Access control: Set read/write permissions per user or group.

Use case: A QA lead creates a smoke‑test flow, shares the test phone pool with developers, and schedules nightly runs. Developers can view the results directly in the dashboard, speeding up feedback loops.

Troubleshooting Common AI Generation Issues

Symptom Likely Cause Fix
Flow missing a step Prompt omitted a clause Expand prompt with "also" or "then" connectors.
Selector unstable AI used text or position Replace with a more specific resource‑id or accessibility‑id.
AI repeats actions Prompt contained ambiguous language Clarify with time limits or conditions ("once", "if successful").
No devices detected USB debugging not enabled or driver missing Re‑enable debugging, reinstall manufacturer driver, restart PC.

Best Practices for Prompting the AI

  1. Be explicit about order: Use "first… then… after that…".
  2. Specify data values: Quote strings, numbers, and special characters.
  3. Add conditional language: Include "if", "when", "unless" for branching logic.
  4. Limit scope: Break complex tasks into smaller prompts to improve clarity.
  5. Review selectors: Always check the AI‑chosen element and replace if it’s likely to change.

Conclusion

Leveraging Phoma’s AI integration transforms vague ideas into concrete, executable automation flows in minutes, not hours. By describing tasks in plain language, you tap into a powerful assistant that understands intent, builds a visual diagram, and lets you fine‑tune it instantly. Whether you’re running a quick smoke test on a single device or orchestrating regression suites across a fleet, the AI‑assisted workflow keeps the process intuitive and reproducible.

Start today: connect a phone, craft a clear prompt, let the AI generate a flow, and watch your automation become a shared, repeatable asset for the whole team.