Pinework receives webhooks. It does not send its own events out to a URL you host.
Before you start
- You have an agent in your workspace. See Create an agent.
- For the CLI tab, you have signed in with
pinework login. - Your system can send an HTTP POST.
Send an event to an agent
1
Create a webhook routine
- Dashboard
- CLI
- In the sidebar, click Automations. Under Routines, click New routine.
- Enter a Name. Under Runs, click Webhook.
- Under What to do, write the prompt. Pick an Agent.
- Click Create routine.
2
POST an event to the URL
Send any body, such as JSON, to the URL. The URL works as a password, so no auth header is needed.When it works, Pinework answers
202 with the run it started:3
Read what the agent did
The agent gets the routine’s prompt, then your body. Pinework marks the body as untrusted outside data. The agent is told to read it as data, never as instructions. The agent sees the first 32 KiB of the body.When the run ends, the agent’s final reply appears in a direct message with the agent. The direct message belongs to the person who created the routine. Open the routine from Automations to see every run in its Run history.
Know what each POST does
- A new body starts a new run. Webhook runs do not wait for each other. Two different bodies start two runs, even at the same time.
- A repeated body starts nothing new. Pinework answers with the run that the same body started before. Put a unique field, such as an event id, in each body.
- A paused or archived routine starts nothing. Pinework still answers
202, with"kind": "skipped"and"reason": "not_active". - A routine takes 60 POSTs per hour. Past that, Pinework answers
429. - A body over 1 MiB is refused with
413. - An unknown or old URL gets
404.
Keep the URL secret
Anyone with the URL can start runs of your agent. Treat it like a password. If the URL leaks or you lose it, mint a new one:- Dashboard
- CLI
Open the routine from Automations. Next to Trigger, click Rotate URL. Confirm with Rotate URL. The Webhook URL dialog shows the new URL once.
Replay a failed delivery from a connected service
Pinework records webhooks that connected services send it as deliveries. A delivery has a status: Received, Verified, Routed, Handled, Failed, Dead or Cancelled. You can replay one that did not get handled.- Dashboard
- CLI
- Open Settings. Under Monitoring, click Activity.
- Click the Webhooks tab, then Deliveries.
- Click the Failed filter and open a delivery. Its page shows the raw body, the parsed payload, the signature result and any error.
- Click Replay, then Confirm replay.
- The delivery is already Handled.
- Pinework stored only part of the body, so the body shows as truncated.
- An agent asks for the replay. A person must replay a delivery.
pinework webhook dead-letter <delivery-id>. To clear a dead one from the unresolved view, click Acknowledge or run pinework webhook acknowledge-dead <delivery-id>.
Schedule a routine
Start the same kind of run on a clock instead.
Add a connection
Link an outside service to your workspace.
Runs
Read what the agent did on each run.