Skip to content
Pine Computer Request access
Menu

15 / 26 Documents and data · Example

Reconcile records

Each marketplace’s payout is taken apart order by order, and every difference goes in one spreadsheet.

Illustration of an example: in your accounting software, September’s payouts from three marketplaces are lined up against your customer’s orders, payout by payout. Cobblestone sends a sign-in code to the seller’s phone, and your customer enters it on the screen. Orders that match are ticked on each payout report; fees and refunds the records don’t show, and an order missing from a payout, each get a line of their own in one spreadsheet of differences.
Who it’s for
Accounting software whose customers sell on several marketplaces and are paid in lump sums.
Why it’s hard
A payout covers a fortnight of orders with fees and refunds already taken off, so a missing order hides inside the total.
You get back
  • A spreadsheet of every difference, order by order
  • Each marketplace’s payout report, as downloaded
How it runs, in your product’s code

At month end, your product hands a computer September’s orders as a spreadsheet. Cobblestone sends a sign-in code to the seller’s phone, so the row turns to “Needs you: code” and your customer enters it on the screen below. The computer downloads the payouts-by-order report and lines each payout up against its orders. Fees and refunds your records don’t show get lines of their own.

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  Compare September’s payouts on each marketplace with the  orders in our records, and list every difference in a  spreadsheet.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.