<?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: How to check the status of a pipeline run submitted via API in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4805805#M8367</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The run on Demand API currently returns only an HTTP status code, such as 202 Accepted, without providing the runId needed to directly query the status of the submitted pipeline run. To work around this limitation, you can use the Get Pipeline Jobs endpoint to retrieve a list of recent pipeline runs after triggering the job. By filtering the results using the pipelineID and the timestamp close to your submission time, you can identify the specific run and extract its runId. Once you have the runId, you can poll the Get Pipeline Job Instance API to check the run status and execution details, such as start time, end time, and current status. If you need a guaranteed way to link the pipeline trigger to its run, consider implementing a logging mechanism that records metadata during the trigger process or explore triggering through the Fabric SDK when it becomes available for more seamless integration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please 'Kudos' and 'Accept as Solution' if this answered your query.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Aug 2025 06:36:34 GMT</pubDate>
    <dc:creator>Vinodh247</dc:creator>
    <dc:date>2025-08-24T06:36:34Z</dc:date>
    <item>
      <title>How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4805340#M8366</link>
      <description>&lt;P&gt;Hi, I want to create a Python notebook to submit pipeline runs and check their status programmatically. Two APIs I plan to use are:&lt;BR /&gt;1. Run on demand pipeline job:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api-capabilities#run-on-demand-pipeline-job" target="_blank" rel="noopener"&gt;&lt;EM&gt;https://community.fabric.microsoft.com/t5/Data-Pipeline/Execute-Data-Pipeline-Via-API/m-p/3740462&lt;/EM&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2. Get pipeline job instance:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api-capabilities#get-pipeline-job-instance" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api-capabilities#get-pipeline-job-instance&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;I initially assumed the two APIs would integrate seamlessly. However, during implementation, I realized that the 'run on demand' API only returns a status code and not the job run ID. Is there a way to retrieve the IDs of jobs submitted through the 'run on demand' API?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 18:43:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4805340#M8366</guid>
      <dc:creator>Jing1018</dc:creator>
      <dc:date>2025-08-22T18:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4805805#M8367</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The run on Demand API currently returns only an HTTP status code, such as 202 Accepted, without providing the runId needed to directly query the status of the submitted pipeline run. To work around this limitation, you can use the Get Pipeline Jobs endpoint to retrieve a list of recent pipeline runs after triggering the job. By filtering the results using the pipelineID and the timestamp close to your submission time, you can identify the specific run and extract its runId. Once you have the runId, you can poll the Get Pipeline Job Instance API to check the run status and execution details, such as start time, end time, and current status. If you need a guaranteed way to link the pipeline trigger to its run, consider implementing a logging mechanism that records metadata during the trigger process or explore triggering through the Fabric SDK when it becomes available for more seamless integration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please 'Kudos' and 'Accept as Solution' if this answered your query.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 06:36:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4805805#M8367</guid>
      <dc:creator>Vinodh247</dc:creator>
      <dc:date>2025-08-24T06:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4806161#M8368</link>
      <description>&lt;P&gt;Plz refer the below blog for trigger and status API integrations :&lt;/P&gt;&lt;P&gt;&lt;A href="https://datasharkx.wordpress.com/2025/03/22/trigger-fabric-data-pipeline-from-azure-data-factory-synapse-pipeline-via-managed-identity/" target="_blank"&gt;https://datasharkx.wordpress.com/2025/03/22/trigger-fabric-data-pipeline-from-azure-data-factory-synapse-pipeline-via-managed-identity/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 04:32:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4806161#M8368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-08-25T04:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4807173#M8375</link>
      <description>&lt;P&gt;Filtering by PipelineId and time range isn't a sufficiently reliable solution—especially since I plan to submit pipeline runs in batches. At this point, the only viable workaround seems to be implementing custom logging that captures an exhaustive list of parameter values along with the PipelineRunId and PipelineId. However, &lt;STRONG&gt;this feels unnecessarily complex for addressing such a fundamental need&lt;/STRONG&gt;. I have proposed an idea at&amp;nbsp;&lt;SPAN&gt;&lt;A title="https://community.fabric.microsoft.com/t5/fabric-ideas/quot-run-on-demand-pipeline-run-quot-api-returns-job-run-id/idi-p/4805343#m163309" href="https://community.fabric.microsoft.com/t5/Fabric-Ideas/quot-Run-on-demand-pipeline-run-quot-API-returns-job-run-Id/idi-p/4805343#M163309" target="_blank" rel="noreferrer noopener"&gt;"Run on demand pipeline run" API returns job run I... - Microsoft Fabric Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 17:34:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4807173#M8375</guid>
      <dc:creator>Jing1018</dc:creator>
      <dc:date>2025-08-25T17:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4811824#M8403</link>
      <description>&lt;P&gt;Thanks for submitting idea in ideas forum.&amp;nbsp;&lt;SPAN data-teams="true"&gt;Feedback submitted here is often reviewed by the product teams and can lead to meaningful improvement.&lt;/SPAN&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;/P&gt;
&lt;P&gt;Prashanth&lt;/P&gt;
&lt;P&gt;MS Fabric community&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 16:09:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4811824#M8403</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-08-29T16:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4814957#M8417</link>
      <description>&lt;P&gt;After syncing internally with domain experts, we discovered that—despite the lack of mention in the official documentation—the API call does return some metadata. For example, the job run URL can be fetched via response.headers['location'].&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;&lt;U&gt;&lt;SPAN&gt;Sample Response Headers&lt;/SPAN&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;cache-control: no-store, must-revalidate, no-cache&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;pragma: no-cache&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;content-type: application/octet-stream&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;location: &lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmsitapi.fabric.microsoft.com%2Fv1%2Fworkspaces%2F79294ce5-364b-4936-b251-f5a864181ddd%2Fitems%2Fd831951a-15bf-4998-aad9-0decd1ab9f85%2Fjobs%2Finstances%2F38fd5429-136b-4041-9353-211d561039f8&amp;amp;data=05%7C02%7Cjijing%40microsoft.com%7C546649cbc4db444e9e3208dde72bbd2a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638920897219781580%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&amp;amp;sdata=bmQ6ceAQx8Eyrz8qiN8DVMIGJWASbepKiSRs3cQEBEQ%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;https://msitapi.fabric.microsoft.com/v1/workspaces/79294ce5-364b-4936-b251-f5a864181ddd/items/d831951a-15bf-4998-aad9-0decd1ab9f85/jobs/instances/38fd5429-136b-4041-9353-211d561039f8&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;retry-after: 60&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;&lt;SPAN&gt;x-ms-job-id: 38fd5429-136b-4041-9353-211d561039f8&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;strict-transport-security: max-age=31536000; includeSubDomains&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;x-frame-options: deny&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;x-content-type-options: nosniff&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;requestid: 1372206e-f857-4e10-9a98-fbbcc5ce0c55&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;access-control-expose-headers: RequestId,Location,Retry-After&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;date: Wed, 27 Aug 2025 05:06:33 GMT&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 18:50:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4814957#M8417</guid>
      <dc:creator>Jing1018</dc:creator>
      <dc:date>2025-09-02T18:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4820798#M8464</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1240531" data-lia-user-login="Jing1018" class="lia-mention lia-mention-user"&gt;Jing1018&lt;/a&gt;, Thanks for actively updating the thread, you insights truely help our community users. please do post your progress here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Prashanth Are&lt;/P&gt;
&lt;P&gt;MS Fabric community support&lt;/P&gt;</description>
      <pubDate>Tue, 09 Sep 2025 05:46:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4820798#M8464</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-09-09T05:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the status of a pipeline run submitted via API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4820814#M8465</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1240531" data-lia-user-login="Jing1018" class="lia-mention lia-mention-user"&gt;Jing1018&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I use the following code to be able to start a pipeline from the API and then get the status of the pipeline run:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# --- Pipeline start + status tracking ----------------------------------------
import time, json
from sempy.fabric import FabricRestClient

_client = FabricRestClient()

# Polling tunables (you can override these globals elsewhere)
FIRST_POLL_DELAY_SEC = 8         # initial delay before first poll
POLL_INTERVAL_SEC    = 10        # steady-state poll interval
POLL_TIMEOUT_SEC     = 60 * 60   # overall timeout (seconds)

def _start_job_instance_raw(ws_id: str, item_id: str, job_type: str, parameters: dict | None = None):
    url = f"v1/workspaces/{ws_id}/items/{item_id}/jobs/instances?jobType={job_type}"
    body = {}
    if parameters is not None:
        body = {"executionData": {"parameters": {k: {"value": str(v), "type": "string"} for k, v in parameters.items()}}}
    print(f"[POST] {url} (paramKeys={list((parameters or {}).keys())})")
    resp = _client.post(url, json=body)
    print(f"[POST] → {resp.status_code}  Location={resp.headers.get('Location')}")
    return resp

def _start_job_instance(ws_id: str, item_id: str, job_type: str, parameters: dict | None = None) -&amp;gt; str:
    """Start a Fabric job and return the jobInstanceId; raises on non-202."""
    resp = _start_job_instance_raw(ws_id, item_id, job_type, parameters)
    if resp.status_code != 202:
        try:
            details = resp.json()
        except Exception:
            details = resp.text
        raise RuntimeError(f"Start job failed ({resp.status_code}) jobType={job_type}: {details}")
    loc = (resp.headers.get("Location") or "")
    if "/jobs/instances/" not in loc:
        raise RuntimeError(f"202 Accepted but missing job instance Location (jobType={job_type}).")
    return loc.rsplit("/jobs/instances/", 1)[1]

def _get_job_instance(ws_id: str, item_id: str, job_instance_id: str) -&amp;gt; dict:
    """Fetch current state for a job instance."""
    url = f"v1/workspaces/{ws_id}/items/{item_id}/jobs/instances/{job_instance_id}"
    r = _client.get(url)
    r.raise_for_status()
    return r.json()

def start_pipeline_and_track(ws_id: str, item_id: str) -&amp;gt; tuple[int, str, dict]:
    """
    Start a Pipeline job and wait for terminal status.
    Returns: (rc, note_json, final_state_dict)
      rc = 0 if completed, else 1
      note_json = compact JSON summary (jobType, jobInstanceId, status, failureReason)
      final_state_dict = full GET response from the last poll
    """
    # 1) Start
    job_instance_id = _start_job_instance(ws_id, item_id, "Pipeline", parameters=None)

    # 2) Poll
    print(f"[WARMUP] Sleeping {FIRST_POLL_DELAY_SEC}s before first poll (Pipeline {job_instance_id})")
    time.sleep(FIRST_POLL_DELAY_SEC)

    start_ts = time.time()
    tries = 0
    while True:
        st = _get_job_instance(ws_id, item_id, job_instance_id)
        status = (st.get("status") or "").lower()
        print(f"[POLL] {job_instance_id} status={status}")

        if status in ("completed", "failed", "cancelled", "canceled", "deduped"):
            note = {
                "jobType": "Pipeline",
                "jobInstanceId": job_instance_id,
                "status": status,
                "failureReason": st.get("failureReason"),
            }
            return (0 if status == "completed" else 1), json.dumps(note, default=str), st

        # backoff is simple here; you can make it smarter if you like
        time.sleep(POLL_INTERVAL_SEC if tries &amp;lt; 3 else min(POLL_INTERVAL_SEC * 2, 30))
        tries += 1

        if (time.time() - start_ts) &amp;gt; POLL_TIMEOUT_SEC:
            raise TimeoutError(f"Timeout waiting for Pipeline job {job_instance_id}; last state={st}")&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving Kudos. If I solved your problem or answered your question, mark this post as the solution.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Sep 2025 05:51:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-check-the-status-of-a-pipeline-run-submitted-via-API/m-p/4820814#M8465</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-09T05:51:38Z</dc:date>
    </item>
  </channel>
</rss>

