Skip to content
Pine Computer Request access
Menu

05 / 26 Work on sites with no API · Example

Onboard a vendor

Your product registers your customer on a new buyer’s supplier portal, and stops for them at the terms.

Illustration of an example: in your customer’s billing software, three new buyers are set up at once, each on a computer of its own registering Penwright Print Co. on that buyer’s supplier portal from the company’s profile and documents. Acme’s portal reaches its terms; your customer reads them on its screen and accepts them before anything is submitted. Each portal’s confirmation comes back to its buyer’s row with the supplier number it assigned, and Acme’s also flags the bank letter still owed.
Who it’s for
Billing software whose customers must sign up on each new buyer’s portal before their first invoice is paid.
Why it’s hard
Every buyer wants the same details in a different form, with its own list of documents. Acme’s terms bind your customer on every order, so accepting them is their call.
You get back
  • The portal’s confirmation, with the supplier number Acme assigned
  • Any document still owed, like Acme’s bank letter on letterhead
How it runs, in your product’s code

Your customer adds the buyer and clicks Register. A computer fills in Acme’s form from the company profile and uploads each document to its item on the portal’s list. At the terms, the row turns to “Needs you: terms”, and your customer reads them on the screen beneath the rows and clicks Accept terms.

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  Register Penwright Print Co. as a supplier on Acme’s portal,  from the profile and documents attached. Ask before accepting  the terms.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.