Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
cw_615
New Member

Execute Data Pipeline Via API

I have been attempting to execute a fabric data factory data pipeline via rest API from a synapse pipeline with no success. Has anyone done this? Is this possible currently? I thought I could do this via the Job Scheduler - Run On Demand Item Job but it does not seem to be working or I am just doing something wrong. There does not seem to be much documentation on the job types but based on the example I should be able to run it with the paramater "DefaultJob" as job type, however, I receive errorCode: Invalid Job Type, message: The requested job type is invalid.

Is this something anyone else has accomplished already?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello @cw_615 ,

The Job Scheduler API is missing documentation when it comes to the jobType parameter. If you are trying to run a Data Pipeline on demand, don't use DefaultJob like this.

 

/jobs/instances?jobType=DefaultJob

 

Instead, use Pipeline like this.

 

/jobs/instances?jobType=Pipeline

View solution in original post

10 REPLIES 10
yllsuarez76
Microsoft Employee
Microsoft Employee

Hello,

I am getting an error either running a notebook or a pipeline from synapse,

 

yllsuarez76_1-1713902928731.png

 

 

yllsuarez76_0-1713902660492.png

 

mpoeckl
Microsoft Employee
Microsoft Employee

One additional comment to the solution:

1. If you need to pass parameters to the pipeline, you need to provide a payload/body in the following format:

{   "executionData": {
        "parameters": {
            "YourParameter1": 1,
            "YourParameter2": "Param2
        }
    }
}

 

Tip: if you want to call Fabric APIs from a Fabrik Notebook you can use the semantic link library. This is also a great way of verifying/testing the API calls directly within Fabric:

# Install sempy version 0.4.0 or higher
!pip install semantic-link --q 

import sempy.fabric as fabric

# Init the sempy client
client = fabric.FabricRestClient()

# Fabric REST API call “Job Scheduler – Run On Demand Item Job”
#    Docs: Job Scheduler - Run On Demand Item Job - REST API (Core) | https://learn.microsoft.com/en-us/rest/api/fabric/core/job-scheduler/run-on-demand-item-job
#    HTTP: POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances?jobType={jobType}
#    Body/Payload: {"executionData": { ... } }

# Get the default workspace id of the notebook
workspaceId = fabric.get_workspace_id()
itemId = f"yourPipelineUuid"
jobType = f"Pipeline"
payload = {
            "executionData": {
                "parameters": {
                    "YourParamter1": 1,
                    "YourParamter2": "Param2"
                    }
                }
            }

# Call Fabric REST API with semantic link Fabric REST client (sempy)
# Run without payload / no or default pipeline parameters

response = client.post(f"/v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances?jobType={jobType}")

# Run with payload / pipeline parameters
response = client.post(f"/v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances?jobType={jobType}",json= payload)

 

please add this to the documentation, the docs make no mention of how you should construct the parameters or the appropriate jobtypes



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Anonymous
Not applicable

Hello @cw_615 ,

The Job Scheduler API is missing documentation when it comes to the jobType parameter. If you are trying to run a Data Pipeline on demand, don't use DefaultJob like this.

 

/jobs/instances?jobType=DefaultJob

 

Instead, use Pipeline like this.

 

/jobs/instances?jobType=Pipeline

Hi, I am trying to trigger a pipeline using the HTTPS "Run on Demand" feature and want to automate it with a button click from a model-driven app. Does anyone have any idea how we can achieve this? I tried using Power Automate (Flow), but I wasn't able to find any suitable connector.

I am trying to run a notebook and receiving same error (invalid job type). I tried to use Pipeline and Notebook, but they didn't work. What is suitable jobtype for Notebooks?

Thank you I can confirm that this is the correct answer and works.

Anonymous
Not applicable

Hi @cw_61591 , @cw_615  

Glad to know your query got resolved. Please continue using Fabric Community for your further queries.

Anonymous
Not applicable

Hello @cw_615 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

NandanHegde
Super User
Super User

Unfortunately fabric Data pipeline APIs have yet not been exposed owining to which it is currently not possible to trigger the fabric data pipeline any way other than manual process or scheduled trigger




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.