Code and Slack: AI Log-Error Classifier Template

This Spojit template catches incoming log events, normalizes the payload with a code step, classifies the error type and severity with AI structured output, and posts high-severity issues to Slack.

What It Builds

A Webhook trigger receives a log-event POST, a Connector node on the code connector runs execute-javascript to normalize the raw payload into clean fields, and an Agent-mode Connector node classifies the error type and severity into a fixed JSON shape using a Response Schema. A Condition node then checks the severity, and for high-severity issues a Connector node on the slack connector calls send-message to alert your team channel. Lower-severity events pass through silently so the channel stays signal-rich.

The Prompt

Paste this into Miraxa and it builds the workflow, connecting the tools for you:

Build a workflow with a Webhook trigger that receives a log event. Add a Connector node on the code connector that runs JavaScript to normalize the payload into a clean message, service name, and timestamp. Then add an Agent-mode Connector node that classifies the error into a type and a severity of low, medium, high, or critical, using a Response Schema so the output is structured JSON. Add a Condition node that checks if the severity is high or critical, and on the true branch add a Slack Connector node that sends a message to the #incidents channel with the service name, error type, severity, and the normalized message.

Connectors Used

  • Webhook trigger - receives the log-event POST and exposes the body as {{ input }}.
  • code - execute-javascript reshapes the raw log into consistent fields before classification.
  • slack - send-message posts the alert to your incidents channel (an API key connection with channel-write scope).

Customize It

Change the Slack channel name in the prompt to wherever your on-call team watches (for example #incidents or #alerts). Adjust the severity threshold in the Condition node so only critical alerts page the channel, or widen it to include medium. You can also extend the agent prompt to add fields such as a suggested owner team or a one-line remediation hint, all without writing a second Miraxa prompt.

Tips

  • Keep the classifier in Agent mode with a Response Schema so the type and severity always come back as predictable JSON your Condition node can read.
  • Use Direct mode for the slack step: posting to a known channel is a single deterministic call, so it costs no AI credits.
  • Secure the Webhook trigger with a signing connection so only your logging source can start runs.

Common Pitfalls

  • If the agent returns free text instead of fields, you forgot the Response Schema: define errorType and severity as required properties.
  • Reference webhook data as {{ input.message }}, not a hard-coded value, so the code step normalizes each real payload.
  • Confirm the Slack connection has permission to post in the target channel, or send-message will fail at run time.

Related

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.