Skip to content
Pine Computer Request access
Menu

04 / 26 Work on sites with no API · Example

File government forms

Annual reports reach the state filled in from your records, and only after your customer approves them.

Illustration of an example: in your customer’s compliance software, three companies’ annual reports are filed at once, each on a computer of its own, all on the same state portal. Each computer fills in its company’s report from your records, correcting what has changed, and stops before submitting; your customer reads each report on its screen and approves it. Each state receipt comes back to its company’s row as a PDF.
Who it’s for
Compliance software whose customers keep several companies in good standing, each with its own state.
Why it’s hard
Each state has its own form, and a company’s report falls due in its anniversary month. Submitting certifies the report is true, so your customer has to approve it.
You get back
  • The state’s receipt for each report, as a PDF
  • The report exactly as filed
A real run: an agreement on DocuSign filled in to the last blank, and the signature left to the person. Cookbook 05: Your users stay in control
How it runs, in your product’s code

Your customer selects the companies due this month and clicks File. For each one, a computer opens the state’s form and corrects whatever your records show has changed, such as a new principal office. Before it submits, your customer reads the finished report on the live screen and clicks Approve filing. The state’s receipt is saved as a PDF.

Ruby · task-turn excerpt
# Existing backend Computer and session; see setup docs.# saved_message_id is your durable ID for this request.computer.require_agent_protocol!agent = session.agentgoal = <<~JOB  File this month’s annual reports on the state’s portal. Ask  before submitting each one, and save the state’s receipt.JOBturn = agent.run(goal, idempotency_key: saved_message_id)# Persist turn.turn_id before waiting or leaving this process.turn = agent.wait(turn_id: turn.turn_id, timeout: 30)case turn.statewhen "running", "canceling"  # Schedule another wait for this turn ID.when "needs_input"  # Present turn.question; authorize any desktop handoff.  # When the user replies, answer this turn and save the new ID:  # agent.answer(turn_id: turn.turn_id, answer: reply.text)when "answered"  # Continue with turn.next_turn_id; do not resubmit the goal.when "completed"  turn.result.artifacts.each do |file|    bytes = session.read_file(file.fetch("relative_path"))    # Save bytes in your own file store before stopping.  end  # Verify the outputs and external state against the request.when "failed", "canceled"  # Record the outcome; check side effects before any retry.end

Requires a configured Computer, session and durable request ID. The comments mark application logic you supply; this excerpt does not implement storage, polling or human handoff. Agent integration · Saving outputs

Build more.
Hand AI the work.