Files
crm.clientright.ru/aiform_dev2/docs/n8n_code_error_response.js
Fedor 01c4fe80b5 chore: snapshot current working tree changes
Save all currently accumulated repository changes as a backup snapshot for Gitea so no local work is lost.
2026-03-26 14:19:01 +03:00

28 lines
907 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code23 — помещаем в n8n-nodes-base.code (JS), Mode = Run Once for All Items
// Берём все входные элементы
const items = $input.all();
// Предполагаем, что нас интересует первый элемент массива
const data = items[0].json;
// Всегда возвращаем сообщение об ошибке
const answerText = 'Извините, произошла ошибка, мы уже работаем над ее устранением, попробуйте задать ваш вопрос еще раз через некоторое время';
// Собираем единый объект для следующего узла
return [
{
json: {
...data,
respound: {
type: 'text',
text: answerText,
replyMarkup: {
remove_keyboard: true
}
}
}
}
];