Skip to content
Pine Computer Request access
Menu

12 / 26 Documents and data · Example

Fill PDF forms

Each client’s row on the broker’s sheet becomes a filled copy of the insurer’s current PDF form.

Illustration of an example: in your broker software, each client’s row on the renewals sheet becomes a filled copy of Bluefield’s current PDF form. A computer fills the form field by field, reads every field back against the row, and puts the copy on a pile, one per client. Nothing goes to Bluefield until the broker has read each copy.
Who it’s for
Broker software whose users copy client details from a spreadsheet into each insurer’s PDF application.
Why it’s hard
Bluefield rejects applications on an older version of its form, so last year’s copy is no use. A sprinkler question answered “no” by mistake changes the quote.
You get back
  • A filled PDF for each client, on Bluefield’s current form
  • Questions the sheet couldn’t answer, listed for the broker
  • Bluefield’s acknowledgement of each application
How it runs, in your product’s code

The broker picks the renewals and clicks Fill. A computer fills Bluefield’s current form for each client, then reads every field back against the client’s row. Questions the sheet doesn’t answer are left blank and listed. Before anything goes to Bluefield, the broker reads each filled PDF and clicks Submit application.

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  Fill Bluefield’s commercial property application for each  client on this sheet, and submit each once the broker  approves.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.