Appmixer
Search…
System Webhooks
Appmixer Engine Events.

Component Errors

Components might throw exceptions. Such exceptions/errors are logged and user can see them in the Insights. However, you might want to implement your custom logic or notification system for when this occurs. You may want to notify your users or handle/log the errors in a totally custom way.
If you want to listen for component errors you can set the WEBHOOK_FLOW_COMPONENT_ERROR environment variable to a URL that the Appmixer engine will send an HTTP POST request to whenever an error occurs. It can you any external (but accessible) URL or you can even create a flow in Appmixer and point this URL to a Webhook component to handle these errors using Appmixer itself (e.g. by sending an email, Slack notification, ...).
Set the WEBHOOK_FLOW_COMPONENT_ERROR variable in docker-compose.yml file:
1
engine:
2
build:
3
context: .
4
dockerfile: Dockerfile
5
depends_on:
6
- mongodb
7
- rabbitmq
8
- elasticsearch
9
- redis
10
environment:
11
# this variable has to point to your Webhook
12
- WEBHOOK_FLOW_COMPONENT_ERROR=https://your.example.com/error-handling-url
13
Copied!
Example of an error POSTed to your URL (a validation error in this case):
1
{
2
"err": {
3
"message": "Validation error on ports: in",
4
"error": {
5
"in": [
6
[
7
{
8
"keyword": "format",
9
"dataPath": ".to",
10
"schemaPath": "#/properties/to/format",
11
"params": {
12
"format": "email"
13
},
14
"message": "should match format \"email\""
15
}
16
]
17
]
18
},
19
"code": "GRID_ERR_VAL_PORTS",
20
"name": "ValidationFlowError",
21
"stack": "ValidationFlowError: Validation error on ports: in\n at MessagesProcessor.process (/Users/martinkrcmar/Programming/client/appmixer/appmixer-core/engine/src/context/MessagesProcessor.js:67:19)\n at Context.prepare (/Users/martinkrcmar/Programming/client/appmixer/appmixer-core/engine/src/context/Context.js:68:31)\n at ContextHandler.createContext (/Users/martinkrcmar/Programming/client/appmixer/appmixer-core/engine/src/context/ContextHandler.js:60:17)\n at async InputQueue.consume (/Users/martinkrcmar/Programming/client/appmixer/appmixer-core/engine/src/InputQueue.js:151:23)\n at async InputQueue.onMessage (/Users/martinkrcmar/Programming/client/appmixer/appmixer-core/engine/src/AMQPClient.js:378:20)"
22
},
23
"flowId": "32f605b2-8fbe-4f68-9db9-ce182b35c159",
24
"flowName": "New flow",
25
"userId": "5f804b96ea48ec47a8c444a7",
26
"componentId": "0bb33e42-fbc4-464e-98f1-459f1ff626ac",
27
"componentType": "appmixer.utils.email.SendEmail",
28
"inputMessages": {
29
"in": [
30
{
31
"properties": {
32
"correlationId": "339bc448-a806-4e61-8d38-4211fcedaf12",
33
"gridInstanceId": null,
34
"contentType": "application/json",
35
"contentEncoding": "utf8",
36
"sender": {
37
"componentId": "e8c581b4-9985-4f2c-bf30-895bf1d5541b",
38
"type": "appmixer.utils.controls.OnStart",
39
"outputPort": "out"
40
},
41
"destination": {
42
"componentId": "0bb33e42-fbc4-464e-98f1-459f1ff626ac",
43
"inputPort": "in"
44
},
45
"correlationInPort": null,
46
"componentHeaders": {},
47
"flowId": "32f605b2-8fbe-4f68-9db9-ce182b35c159",
48
"messageId": "47293e2c-4e33-4558-8805-386de392ef04",
49
"flowRunId": 1607683798995
50
},
51
"content": {
52
"to": "2020-12-11T10:49:59.050Z"
53
},
54
"scope": {
55
"e8c581b4-9985-4f2c-bf30-895bf1d5541b": {
56
"out": {
57
"started": "2020-12-11T10:49:59.050Z"
58
}
59
}
60
},
61
"originalContent": {
62
"started": "2020-12-11T10:49:59.050Z"
63
}
64
}
65
]
66
},
67
"accessTokenId": null
68
}
Copied!
This error was triggered in a sample flow that looks like this:
The email address in the "To" configuration field of the SendEmail component points to a variable from the OnStart component. Its value is dynamic, it is only known during runtime. Therefore the user is allowed to start such a flow, but it will fail at runtime. Start time variable contains a date string, but the SendEmail address requires a valid email address in the To input field. The error will be logged and seen in the log viewer.
Log viewer in Designer.
Consider the flow is configured correctly this time and the email address is valid. But there is a network error and Appmixer cannot send the email.
This error will be logged and the user will be able to see it in the log viewer or in the Insights. And the JSON representing this error will look like this:
1
{
2
"err": {
3
"stack": "Error: getaddrinfo ENOTFOUND mandrillapp.com\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)",
4
"message": "getaddrinfo ENOTFOUND mandrillapp.com",
5
"errno": "ENOTFOUND",
6
"code": "ENOTFOUND",
7
"syscall": "getaddrinfo",
8
"hostname": "mandrillapp.com",
9
"name": "Error"
10
},
11
"flowId": "0ab287ef-7bd6-4cc3-b53b-c916c857cbe7",
12
"flowName": "Invalid email test",
13
"userId": "5fd744d5e9ed7d0011ca35f9",
14
"componentId": "cb3f4ff5-7b6e-4d24-b7a8-2115c8254baa",
15
"componentType": "appmixer.utils.email.SendEmail",
16
"inputMessages": {
17
"in": [
18
{
19
"properties": {
20
"correlationId": "254ad628-f9c1-4483-81ed-33a22ac3ddc6",
21
"gridInstanceId": null,
22
"contentType": "application/json",
23
"contentEncoding": "utf8",
24
"sender": {
25
"componentId": "bcbeda1d-9036-45af-a25d-a57cf06e3f90",
26
"type": "appmixer.utils.controls.OnStart",
27
"outputPort": "out"
28
},
29
"destination": {
30
"componentId": "cb3f4ff5-7b6e-4d24-b7a8-2115c8254baa",
31
"inputPort": "in"
32
},
33
"correlationInPort": null,
34
"componentHeaders": {},
35
"flowId": "0ab287ef-7bd6-4cc3-b53b-c916c857cbe7",
36
"messageId": "33b9fcbf-b326-4eb4-bba6-cf34979f4ba2",
37
"flowRunId": 1607944841843,
38
"quotaId": "qs-4882d03d-65e1-44dc-983e-d2a33071779d"
39
},
40
"content": {
41
"to": [
42
{
43
"email": "[email protected]",
44
"type": "to"
45
}
46
],
47
"from_email": "[email protected]"
48
},
49
"scope": {
50
"bcbeda1d-9036-45af-a25d-a57cf06e3f90": {
51
"out": {
52
"started": "2020-12-14T11:20:41.858Z"
53
}
54
}
55
},
56
"originalContent": {
57
"started": "2020-12-14T11:20:41.858Z"
58
}
59
}
60
]
61
},
62
"accessTokenId": null
63
}
Copied!
Last modified 11mo ago
Copy link