Hi everyone,
I’m working on an n8n workflow that processes JSON for Slack Block Kit, ensuring that it meets all formatting, encoding, and structure requirements before sending messages to Slack. The workflow includes:
1️⃣ JSON Evaluator (AI-powered) – Analyzes whether the JSON is valid and returns structured outputs.
2️⃣ Conditional IF Node – If "valid": true, the JSON is sent to Slack; if "valid": false, it is passed to a JSON Fixer that attempts to correct any issues.
3️⃣ JSON Fixer (AI-powered) – Adjusts formatting, encoding, and structure to comply with Slack’s Block Kit.
4️⃣ Re-Evaluation – The corrected JSON goes back to the Evaluator to determine if it is now valid.
Issue I’m Facing
The primary challenge seems to be the structure of the outputs coming from the JSON Evaluator:
• The evaluator’s output structure may be causing deterministic failures.
• It’s unclear how to best structure the outputs to allow smooth validation without forcing a loop due to rigid failure conditions.
• I want to refine the workflow so that the only variable left to improve is the prompt rather than dealing with structural issues in the evaluator’s outputs.
What I Need Help With
🔹 Best practices for structuring AI-based JSON evaluations in n8n.
🔹 How to design outputs so that failures are handled dynamically instead of deterministically failing.
🔹 Should I force a strict JSON schema or allow flexible responses from the evaluator?
🔹 Any proven methods for handling Slack Block Kit JSON validation in n8n?
Would love to hear any insights, best practices, or similar experiences! Thanks in advance! 🙌