How to log AI agent runs to Google Sheets for governance with Make?

:bullseye: What is your goal?

Build a simple governance log for our AI agents. Every time an agent finishes or fails a task, Make should record the agent name, task ID, status and time in a Google Sheet. Our agents run in Sharkly.ai (disclosure: I work on it) and post results back as Jira comments.

:thinking: What is the problem?

I’m not sure how to parse the incoming data reliably, or how to send failures to Slack while still logging everything.

:test_tube: What have you tried so far?

A Custom Webhook as the trigger.
A Router with two branches: all runs → Google Sheets “Add a Row” and status = failed → Slack.
I haven’t figured out whether to put the filter before or after the Sheets module.

What’s the cleanest structure for this?

Filter goes after the router. Top row always gets executed and the item is logged in the sheet. Bottom row triggers only on fails and sends a slack message.

Put the filter on the route, not before Sheets. Use a Router with one route with no filter going to Add a Row, so everything gets logged, and a second route filtered on status equals failed going to Slack. Run the webhook once with a sample payload so Make learns the structure, then map the fields from there.

Thanks, both explanations make sense. I’d also make sure the webhook payload is normalized before the router, so the status field has a consistent value such as completed or failed.

Then the structure would be:

  1. Custom Webhook receives the event.

  2. Parse or normalize the payload if needed.

  3. Router splits into two routes:

    • Logging route: no filter → Google Sheets “Add a Row” for every event.

    • Failure alert route: filter status = failed → Slack notification.

That way, failed tasks are still recorded in the sheet before the alert route is evaluated. I’d also test with both a successful and a failed sample payload to confirm the field mapping and filter behavior.

Since the agents run in Sharkly.ai and report back through Jira comments, I’d keep the governance log focused on the structured event payload rather than trying to parse the Jira comment text whenever possible.

The router answer above is the right structure. A few additions that make the sheet hold up as a governance log rather than just a list:

  1. Add a run ID and dedupe on it. Webhooks can be retried, so include the agent’s task/run ID in the payload and use Search Rows first (or a Data Store keyed on run ID) before Add a Row. Otherwise a retry shows up as two runs.
  2. Log the time the agent reported, plus the time Make received it. Two columns: agent_finished_at from the payload and {{now}} as logged_at. When something looks off later, the gap tells you whether the delay was in the agent or the pipeline.
  3. Store a short version of the input and output (first 200–300 characters, or a link to the full result) and the model/version if the agent sends it. “Status = success” on its own doesn’t show what the agent did, and that’s usually what someone asks for in a review.
  4. Catch Make’s own failures too. Add an error handler on the Sheets module (Resume or Break with retries). If the Sheets write fails, the run is silently missing from your log, which is the worst outcome for governance.
  5. Set the webhook’s data structure explicitly (Redetermine once with a real sample, or define it in the webhook settings) so a missing field from the agent doesn’t shift columns.

If the volume grows, Sheets gets slow past a few tens of thousands of rows. At that point, the same scenario can write to a Data Store or a database, and keep the Sheet as a daily summary.