# Get Job Status — Dataiku

> Check the status of a DSS build job, returned as baseStatus.status. Poll this after Build Dataset using the id it returned. NOT_STARTED and RUNNING mean the job is still in flight; DONE, FAILED and ABORTED are terminal, so stop polling on…

- Key: `dataiku-get-job-status`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Dataiku (`dataiku`) — https://pipedream.com/apps/dataiku.md
- This page (HTML): https://pipedream.com/apps/dataiku/actions/get-job-status
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/dataiku/actions/get-job-status/get-job-status.mjs

## Description

Check the status of a DSS build job, returned as `baseStatus.status`. Poll this after **Build Dataset** using the `id` it returned. `NOT_STARTED` and `RUNNING` mean the job is still in flight; `DONE`, `FAILED` and `ABORTED` are terminal, so stop polling on any of them and treat `FAILED`/`ABORTED` as an unsuccessful build. Use **List Jobs** to recover a job ID you no longer have. Requires the `MONITOR_JOBS` privilege on the project. [See the documentation](https://doc.dataiku.com/dss/api/15/rest/#jobs-job-get)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `projectKey` | `string` | Yes | The key of the DSS project, e.g. MYPROJECT. Call List Projects and pass the projectKey field of the project you want. This is an identifier, not the project's display name — a display name will not resolve. In the Dataiku DSS GUI the same value appears in the project's URL as /projects/MYPROJECT/. |
| `jobId` | `string` | Yes | The ID of a job in the project, e.g. build_something_2016_02_10_21_23_34. Build Dataset returns this as the id field of its response; List Jobs returns it as jobId. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "dataiku",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "dataiku-get-job-status",
  arguments: {
    projectKey: "Project Key",
    jobId: "Job ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "dataiku-get-job-status",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    dataiku: { authProvisionId: "apn_xxxxxxx" },
    projectKey: "Project Key",
    jobId: "Job ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "dataiku-get-job-status",
    "configured_props": {
      "dataiku": { "authProvisionId": "apn_xxxxxxx" },
      "projectKey": "Project Key",
      "jobId": "Job ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/dataiku.md · All apps: https://pipedream.com/apps
