오류 처리#
흐름 로직을 설계할 때 잠재적인 오류를 고려하고 이를 정상적으로 처리하는 방법을 설정하는 것이 좋습니다. 오류 워크플로우를 사용하면 n8n이 워크플로우 실행 실패에 응답하는 방식을 제어할 수 있습니다.
오류 조사
실패한 실행을 조사하려면 다음을 수행할 수 있습니다.
- 단일 워크플로우 또는 액세스 권한이 있는 모든 워크플로우에 대한 실행을 검토합니다. 이전 실행에서 데이터 로드를 현재 워크플로우로 가져올 수 있습니다.
- 로그 스트리밍을 활성화합니다.
오류 워크플로우 생성 및 설정#
각 워크플로우에 대해 워크플로우 설정에서 오류 워크플로우를 설정할 수 있습니다. 실행이 실패하면 실행됩니다. 즉, 예를 들어 워크플로우 실행 오류 시 이메일 또는 Slack 알림을 보낼 수 있습니다. 오류 워크플로우는 오류 트리거로 시작해야 합니다.
여러 워크플로우에 동일한 오류 워크플로우를 사용할 수 있습니다.
- Create a new workflow, with the Error Trigger as the first node.
- Give the workflow a name, for example
Error Handler
. - Select Save.
- In the workflow where you want to use this error workflow:
- Select Options
> Settings.
- In Error workflow, select the workflow you just created. For example, if you used the name Error Handler, select Error handler.
- Select Save. Now, when this workflow errors, the related error workflow runs.
- Select Options
오류 데이터#
The default error data received by the Error Trigger is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
All information is always present, except:
execution.id
: requires the execution to be saved in the database. Not present if the error is in the trigger node of the main workflow, as the workflow doesn't execute.execution.url
: requires the execution to be saved in the database. Not present if the error is in the trigger node of the main workflow, as the workflow doesn't execute.execution.retryOf
: only present when the execution is a retry of a failed execution.
If the error is caused by the trigger node of the main workflow, rather than a later stage, the data sent to the error workflow is different. There's less information in execution{}
and more in trigger{}
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
중지 및 오류를 사용하여 워크플로우 실행 실패 유발#
오류 워크플로우를 생성하고 설정하면 실행이 실패할 때 n8n이 실행합니다. 일반적으로 이는 노드 설정 오류 또는 워크플로우 메모리 부족과 같은 문제 때문입니다.
중지 및 오류 노드를 워크플로우에 추가하여 선택한 상황에서 실행이 강제로 실패하도록 하고 오류 워크플로우를 트리거할 수 있습니다.