Skyvern: Complete and Check a Multi-step Form Draft

Configure a local Skyvern environment, fill a bounded procurement draft in a test system, handle validation and uploads, and verify the resulting business state.

16Yun Engineering TeamOct 28, 20264 min read

Multi-step forms connect actions through business rules. Totals update after inputs, uploads must finish before progression, and validation can leave a task on an earlier step.

This tutorial creates a procurement draft in a test system you provide: basic details, line items, and preview. It saves a draft without formal approval or payment. No public procurement application is implied.

Prepare the local environment

Use Python 3.12 and Bash:

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install 'skyvern[all]==1.0.56'

For the library's OpenAI provider path:

export ENABLE_OPENAI=true
export OPENAI_API_KEY='replace-with-your-key'
export LLM_KEY='replace-with-an-enabled-registry-key'
skyvern quickstart --no-postgres

Replace the key and choose an enabled registry value supported by this Skyvern version and your account. LLM_KEY is a Skyvern registry key, not necessarily a provider model identifier. See the model configuration guide.

The example chooses a local path without starting Postgres. Preserve existing data rather than deleting a database as a routine startup fix. See the official installation instructions.

Open the workspace reported at startup and confirm UI, API, browser, and model readiness separately.

Define the form and inputs

Use a repeatable test account with these capabilities:

StageInputs or actionEvidence
Basic detailsDepartment, contact, required dateValidation clears
Line itemsName, quantity, unit price, descriptionCorrect amount and currency
AttachmentSupplied test fileFilename and completed upload
PreviewSave draftDraft identifier and status

Use an explicit valid date, not a relative phrase. The example line item has quantity two and price 12.50 CNY, implying 25.00 CNY before any other application-specific charges.

The upload must be reachable from the actual browser environment. A desktop path is not automatically available inside a container or cloud browser.

Create a bounded workspace task

Provide the actual test entry and complete the date and attachment parameters:

Open the specified test procurement form and create a draft only.
Department: 技术测试 (Technical Testing); contact: Test User;
required date: use the explicit date supplied as a task parameter.
Line item: 办公用品测试项 (office supplies test item), quantity 2, unit price 12.50 CNY.
Upload the supplied test-description file and wait for upload completion.
Resolve required-field validation using these inputs; do not guess other business data.
Save the draft, open its preview, and read its ID, status, item quantities, and amounts.
Do not submit for approval, pay, or create a second identical application.
Stop and identify missing inputs whenever required information or the next action is unclear.

Save the mapping between task parameters and business fields for repeated use.

A textual instruction to avoid submission is not an authorization mechanism. Use a test system or account whose available operations match the draft-only boundary.

Resolve validation before proceeding

Inspect required-date errors on the first step and repair the specified field rather than clicking Next repeatedly.

On the line-item page, identify quantity and unit price by their meaning, not input position. Read the updated amount afterward.

For attachments, check completion and filename rather than a file-picker action alone. Save only after required stages are complete, then inspect the preview.

Preserve a reviewable result

An application-side result contract could be:

{
  "draft_id": "Read from the preview",
  "status": "draft",
  "department": "技术测试",
  "line_items": [
    {"name": "办公用品测试项", "quantity": 2, "unit_price": "12.50", "currency": "CNY"}
  ],
  "total": "25.00",
  "attachment_name": "Actual filename supplied by the task",
  "preview_url": "Actual preview URL"
}

This is an illustrative business structure, not a fixed Skyvern SDK response or captured model output. Map actual page evidence into it.

Open the preview with the test account and verify the ID, draft status, values, and attachment. Inspect the draft list for duplicate creation where available.

Structured completion still requires these checks; an agent verdict cannot establish absence of duplicates or correct money.

Recover without duplicating work

After interruption, inspect the existing draft list before starting creation again. Continue a known draft when appropriate.

A navigation failure and an ambiguous save outcome have different retry implications. The latter requires checking the side effect first.

Batch work needs an application task identity linked to any existing draft ID. If the target lacks idempotent creation, use query and review rather than claiming exactly-once behavior.

Troubleshoot

The UI runs but model operations fail: inspect provider enablement, registry key, and account access.

Next remains disabled: inspect current validation and upload state; stronger clicking instructions cannot remove business rules.

Attachment path fails: verify file availability in the browser's environment.

Amounts differ: inspect quantity, tax, discount, and currency rather than overwriting totals.

The task fails but a draft exists: inspect the existing ID before recreating it.

A detailed summary lacks a draft ID: establish whether preview was actually reached. Planned actions are not completion evidence.

Form automation is complete only when inputs, validation, resulting state, and side effects agree.

Need an enterprise proxy plan?

We can tailor architecture to your target domains, concurrency, and reliability goals.