# Error Reporting Payload Examples

**URL:** <https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498>\
**Category:** Matillion ETL\
**Created:** [October 5, 2021, 6:45pm UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498 "2021-10-05T18:45:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adwait\_K](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Adwait\_K](https://matillioncommunity.discourse.group/u/Adwait_K)\
**Post date:** [October 5, 2021, 6:45pm UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/1 "2021-10-05T18:45:55Z")

</div>

Hello All,

&nbsp;

I'm testing the Error Reporting feature by sending a message into MS Teams. Anyone care to share an example of their payload? I feel I have the essentials, but maybe I might be missing something. Here's my example:

&nbsp;

{

&nbsp;"title": "Matillion Runtime Error in Job: ${job\_name}",

&nbsp;"text": "Job Name: ${job\_name}

&nbsp; Component Name: ${component\_name}

&nbsp; Component Message: ${component\_message}

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Detailed Error: ${detailed\_error}"

&nbsp;&nbsp;

}

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://matillioncommunity.discourse.group/u/Michael)\
**Post date:** [October 6, 2021, 6:40am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/2 "2021-10-06T06:40:35Z")

</div>

This was our basic payload when we started to use the feature:

{

"title": "Failed Matillion Job in Project ${project\_name}",

"subtitle": "Job Name: ${job\_name}",

"text": "

\*Component Name:\* ${component\_name}

\*\*Component Message:\*\* ${component\_message}

\*Detailed Error:\* ${detailed\_error}

"

}

Nowadays we use a more sophisticated layout which produces the following output:

 ![0694G00000GvOfIQAV_0D74G000007jrTTSAY](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/6929efda50dab98993865119f3a352d94e6b6627.png)

{

"@type": "MessageCard",

"@context": "http://schema.org/extensions",

"themeColor": "0076D7",

"summary": "Failed Matillion Job in Project ${project\_name}",

"sections": [{

"activityTitle": "Failed Matillion Job in Project ${project\_name}",

"activitySubtitle": "Job Name: ${job\_name}",

"activityImage": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Green\_bug.svg/200px-Green\_bug.svg.png",

"facts": [{

"name": "Component Name",

"value": "${component\_name}"

}, {

"name": "Component Message",

"value": "${component\_message}"

}, {

"name": "Detailed Error",

"value": "${detailed\_error}"

}],

"markdown": false

}]

}

---

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [January 11, 2022, 9:25am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/3 "2022-01-11T09:25:12Z")

</div>

Hi [@Michael](https://matillioncommunity.discourse.group/u/Michael)​ .

​

I've been trying ​to handle the error message using webhook post component refer to this topic.

In my case, I would like to post message to slack, not MS Teams.

This is my webhook payload templates below.

​

{

"text": "

​

\*Error:\* Failed Matillion Job at the project below.

\*Project Name:\* ${project\_name}

\*Job Name:\* ${job\_name}

\*Component Name:\* ${component\_name}

\*Component Message:\* ${component\_message}

\*Detailed Error:\* ${detailed\_error}

"

}

​

Then, I put webhook post component on the canvas like this.

 ![0694G00000IIxK8QAL_0D74G000007kPW2SAM](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/f76655fd2bba8aeba5896ac763932f05819420b5.png)

​

What I would like to do is that if the Sharding Retry component was failed, webhook post component will get error detail and post it to slack channel.

But when I run this job, variables were not substituted.

One thing that I tried was define environment variables, but the result was not changed.

I think I don’t need to define variables like ‘component\_name’, ‘job\_name’ and things like these because it has already defined by Matillion originally, but should I define again or do something??

Thank you.

​

---

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [January 13, 2022, 5:04am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/4 "2022-01-13T05:04:29Z")

</div>

Dear [@Michael](https://matillioncommunity.discourse.group/u/Michael)​

​

Thank you for your prompt reply.

​As you said, it was successful when I write like "{{component\_name}}" on Manage Webhook Payloads template.

In addition, I understand that If I don't define template and use custom at property, I could write "${component\_name}" and it was successful.

​

Thank you for your explanation and I hope it's gonna be useful for all Matillion user.

---

<div class="post-metadata">

**Author:** ![Adwait\_K](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Adwait\_K](https://matillioncommunity.discourse.group/u/Adwait_K)\
**Post date:** [October 20, 2021, 2:52pm UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/5 "2021-10-20T14:52:27Z")

</div>

This is absolutely above and beyond anything I was doing. Thanks so much for this!!

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://matillioncommunity.discourse.group/u/Michael)\
**Post date:** [January 12, 2022, 9:53am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/6 "2022-01-12T09:53:29Z")

</div>

I think the magic is to escape the variables correctly. For unknown reasons, Matillion apparently decided to design both the "Manage Error Reporting" and the "Webhook component in a different way.

My example works for the "Manage Error Reporting" feature. If you use the Webhook, try to escape variables as follows:

&nbsp;

**"value": "{{load\_error}}"**

&nbsp;

You don't have to re-define environment variables.

---

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [January 13, 2022, 6:07am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/7 "2022-01-13T06:07:27Z")

</div>

Dear [@Michael](https://matillioncommunity.discourse.group/u/Michael)​

​

There is an additional problem about webhook component, so I'm glad if you know how to solve this problem,.

​

First, I could handle error report as I wrote previous post.

Then, I would like to define it as a Shared Jobs because I don't want to define on each job.

​

This is my webhook payloads template named error\_report.json below.

​

{

"blocks": [

{

"type": "header",

"text": {

"type": "plain\_text",

"text": ":warning: Matillion Runtime Error in Job: {{job\_name}} :warning:"

}

},

{

"type": "divider",

"block\_id": "divider1"

},

{

"type": "section",

"text": {

"type": "mrkdwn",

"text": "\*Project group:\* {{project\_group\_name}} \n \*Project:\* {{project\_name}} \n \*Job name:\* {{job\_name}} \n \*Full error message:\* \n {{detailed\_error}}"

}

},

{

"type": "actions",

"elements": [

{

"type": "button",

"text": {

"type": "plain\_text",

"text": "Open Project"

},

"url": "{{url}}"

}

]

}

]

}

​

Then, this is some orchestration in order to create Shared Jobs.

 ![0694G00000IJEmkQAH_0D74G000007kQbISAU](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/dc7584173a7db71c3246d906abe323c4b7906570.png)

​

 ![0694G00000IJEnJQAX_0D74G000007kQbISAU](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/8d102a5017f8c8cea3a5c9157320c121cbdd2a6c.png)

​

After I define it as a Shared Jobs, I use it on orchestration job like this.(Sharding Retry component is gonna be failure)

 ![0694G00000IJEnYQAX_0D74G000007kQbISAU](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/c179713da7c5f4ed162ff36f3303665631a27ea7.png)

​

As a result, there is a notification to my slack channel, but ‘job\_name’ is equal to shared job’s component name like this.

 ![0694G00000IJEoRQAX_0D74G000007kQbISAU](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/b7a9d313770c60964daeaa1878d6d5bf183168a0.png)

I could get 'detailed error' but I can't get 'job\_name' , so if someone know how to get 'job\_name'(not shared jobs component name), please let me know.

Thank you.

---

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [January 21, 2022, 7:24am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/8 "2022-01-21T07:24:17Z")

</div>

​Dear Michael

​

Thank you for your reply and explanation in detail.

Thanks to your advise, It was successful and this is what I wanted to do!!

​

I really appreciate it and hope it will useful for other Matillion user.

---

<div class="post-metadata">

**Author:** ![fernando.hidalgo](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fernando.hidalgo](https://matillioncommunity.discourse.group/u/fernando.hidalgo)\
**Post date:** [April 28, 2022, 1:08pm UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/9 "2022-04-28T13:08:50Z")

</div>

Thanks Michael!

&nbsp;

What I am doing is to add variables to the Payload Template, like **"job\_name": "{{job\_name}}"** and then define the Payload Variable **job\_name** as **$(job\_name)**.

&nbsp;

I guess there is not easier way of doing this, right?

&nbsp;

Hopefully Matillion sort this out at some point.

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://matillioncommunity.discourse.group/u/Michael)\
**Post date:** [April 29, 2022, 11:21am UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/10 "2022-04-29T11:21:21Z")

</div>

Yes, I guess that's currently the best way to go...

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://matillioncommunity.discourse.group/u/Michael)\
**Post date:** [January 19, 2022, 2:04pm UTC](https://matillioncommunity.discourse.group/t/error-reporting-payload-examples/1498/11 "2022-01-19T14:04:48Z")

</div>

I think you can't use $[job\_name} directly in the shared job as this variable will always point to the currently running job (which is the shared job in this case).

&nbsp;

Try to add a public variable to the shared job and call it "my\_job\_name". Then, from the job where you have "Sharding Retry", assign "my\_job\_name" the value ${job\_name}. This should pass the name of the outer job to the inner (shared) job.
