Pass all data through guardrail

Describe the problem/error/question

Is there a way to pass all data from the previous node through a guardrail?

If I use {{ $(‘Set Fields’).all() }} the guardrail node doesn’t sanitize the data.

What is the error message (if any)?

0

name:personalData

triggered:false

info

analyzerResults:[empty array]

Please share your workflow

Share the output returned by the last node

0
name:personalData
triggered:false
info
analyzerResults:[empty array]

Information on your n8n setup

  • n8n version: - Cloud. Running latest version
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main): n/a
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud
  • Operating system: n/a

Hey @Shaun

try the below solution.

Steps:

  1. Edit (based on your workflow)
  2. Code - stringify the object
  3. Guardrails - passing stringified object from step 2
  4. Code - paring to object output from Guardrails

Thanks. I thoughts about stringify.

Can do this with this command straight into the guardrails node

{{ JSON.stringify($(‘Set Fields’).all())}}

It would be nice, however, if there was a way to run all the data through guardrail and maintain the structure without having to break it down to a string and then recreate it.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.