<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Capture current status of pipeline runs in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4625575#M8219</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, It is possible to capture logs in real-time and send an email notification once the pipeline succeeds, including details of the main pipeline and its child pipelines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steps to Capture Logs and Send Email Notifications:&lt;/P&gt;
&lt;P&gt;You can use the Query Activity Runs API to track real-time execution status. If you are seeing Inactive for your notebook, it might not have started yet, or there might be an issue with the pipeline execution.&lt;/P&gt;
&lt;P&gt;Try calling the API like this in your notebook or using a REST client:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import requests

import json



base_url = "https://api.fabric.microsoft.com/datafactory/"

pipeline_name = "YourPipelineName"

resource_group = "YourResourceGroup"

subscription_id = "YourSubscriptionID"

factory_name = "YourFactoryName"



# Construct API URL

url = f"{base_url}subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.DataFactory/factories/{factory_name}/queryActivityRuns?api-version=2018-06-01"



headers = {

    "Authorization": "Bearer YOUR_ACCESS_TOKEN",

    "Content-Type": "application/json"

}



# Define request payload

payload = {

    "filter": f"PipelineName eq '{pipeline_name}'",

    "orderBy": "RunStart desc"

}



# Make API request

response = requests.post(url, headers=headers, data=json.dumps(payload))



# Print results

if response.status_code == 200:

    print("Activity Runs Data:", response.json())

else:

    print("Error:", response.text)

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Automate Email Trigger: Use Webhooks or Azure Logic Apps to trigger an email when the pipeline completes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Mar 2025 09:49:24 GMT</pubDate>
    <dc:creator>v-prasare</dc:creator>
    <dc:date>2025-03-26T09:49:24Z</dc:date>
    <item>
      <title>Capture current status of pipeline runs</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4624482#M8199</link>
      <description>&lt;P&gt;Hi Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an extended ask of my previous post:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Data-Pipeline/Trigger-Alerts-Notification-for-successful-failed-Pipelines/td-p/4615783" target="_blank"&gt;Trigger Alerts Notification for successful/failed ... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to log my status using API and pass it to my outlook activity, however when I pass my queryactivities api(&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#query-activity-runs" target="_self"&gt;https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#query-activity-runs&lt;/A&gt;) to capture the current status while running the pipeline, I get an error. When I run my notebook I get status inactive, when I call the same notebook in my pipeline I get the error.&lt;BR /&gt;&lt;BR /&gt;Please find the attached screenshot:&lt;/P&gt;&lt;P&gt;Notebook Run:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pipeline Run:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to capture the logs real time and once the pipeline succeeds, can I capture the pipeline status with it's child pipelines and send an email notification something like below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any thoughts would really be appreaciated!&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance!&lt;BR /&gt;Hrishi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 16:07:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4624482#M8199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-25T16:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Capture current status of pipeline runs</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4625575#M8219</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, It is possible to capture logs in real-time and send an email notification once the pipeline succeeds, including details of the main pipeline and its child pipelines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steps to Capture Logs and Send Email Notifications:&lt;/P&gt;
&lt;P&gt;You can use the Query Activity Runs API to track real-time execution status. If you are seeing Inactive for your notebook, it might not have started yet, or there might be an issue with the pipeline execution.&lt;/P&gt;
&lt;P&gt;Try calling the API like this in your notebook or using a REST client:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import requests

import json



base_url = "https://api.fabric.microsoft.com/datafactory/"

pipeline_name = "YourPipelineName"

resource_group = "YourResourceGroup"

subscription_id = "YourSubscriptionID"

factory_name = "YourFactoryName"



# Construct API URL

url = f"{base_url}subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.DataFactory/factories/{factory_name}/queryActivityRuns?api-version=2018-06-01"



headers = {

    "Authorization": "Bearer YOUR_ACCESS_TOKEN",

    "Content-Type": "application/json"

}



# Define request payload

payload = {

    "filter": f"PipelineName eq '{pipeline_name}'",

    "orderBy": "RunStart desc"

}



# Make API request

response = requests.post(url, headers=headers, data=json.dumps(payload))



# Print results

if response.status_code == 200:

    print("Activity Runs Data:", response.json())

else:

    print("Error:", response.text)

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Automate Email Trigger: Use Webhooks or Azure Logic Apps to trigger an email when the pipeline completes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 09:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4625575#M8219</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-03-26T09:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Capture current status of pipeline runs</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4625848#M8228</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="845241" data-lia-user-login="v-prasare" class="lia-mention lia-mention-user"&gt;v-prasare&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Also I tried another workaround, since i don't want to automate using logic apps or webhooks. If someone is checking for a Fabric solution, you can try the below:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I created my flow this way:&lt;BR /&gt;&lt;BR /&gt;You need to create 1 pipeline and 2 notebooks&lt;/P&gt;&lt;P&gt;Notebook 1 - Create a Notebook that calls another Pipeline using API's.&lt;/P&gt;&lt;P&gt;Notebook 2 - captures the latest pipeline log&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pipeline 1 - Create a pipeline with 3 activities &lt;STRONG&gt;Wait&lt;/STRONG&gt;&amp;nbsp;&amp;gt; Notebook 2 &amp;gt; Outlook activity&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your Master Pipeline with a Notebook 1 will automatically trigger when pipeline schedule runs, your pipeline 1 is called where it waits (in order for the pipeline status to reflect in monitor (manage latency)) and then the pipeline is logged and outlook activity will send an email notification.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the notification something like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Hrishi&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 12:27:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Capture-current-status-of-pipeline-runs/m-p/4625848#M8228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-26T12:27:05Z</dc:date>
    </item>
  </channel>
</rss>

