Skip to content
Pine Computer Request access
Menu

19 / 26 Assistants that finish the request · Example

Resolve a support request

A damaged order is replaced and its delivery charge refunded once a team lead approves.

Illustration of an example: in your support desk, A. Mensah’s request says order 20517 arrived damaged. A computer opens a tab for each site the request needs, shown on a small live screen in the request: it finds the carrier’s delivery record, places a replacement, order 20532, and sets up a refund of the £4.95 delivery charge on Tillpoint, then stops. A team lead takes the controls, reads the amount on the screen, approves the refund and hands back. Each step is saved to the request as a file.
Who it’s for
Customer-support software whose requests can only be closed by working in two or three back offices.
Why it’s hard
A Tillpoint refund can’t be cancelled once issued, so a team lead approves each one.
You get back
  • The carrier’s delivery record, saved to the request
  • The replacement’s order number
  • The refund, issued after a team lead approved it
How it runs, in your product’s code

A computer opens a tab for each site the request needs. It finds the carrier’s note for order 20517, then places the replacement in the store. On Tillpoint it sets up a refund of the delivery charge and stops, and a team lead reads the amount on the screen below and clicks Approve refund. Each step is saved to the request as a file.

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  Order 20517 arrived damaged. Confirm it on the carrier’s  record and send a replacement. Refund the delivery charge once  a team lead 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.