# Create Decision — Decision Journal

> Creates a new decision in the Decision Journal. See the documentation

- Key: `decision_journal-create-decision`
- Type: Action (Write)
- Version: 0.0.2
- App: Decision Journal (`decision_journal`) — https://pipedream.com/apps/decision-journal.md
- This page (HTML): https://pipedream.com/apps/decision-journal/actions/create-decision
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/decision_journal/actions/create-decision/create-decision.mjs

## Description

Creates a new decision in the Decision Journal. [See the documentation](https://openpm.ai/apis/decision-journal#/decisions)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `title` | `string` | Yes | The title of the decision |
| `tags` | `string[]` | No | Tags for a decision to organize |
| `status` | `string` | Yes | The status of a decision or review |
| `context` | `string` | Yes | The context or background of the decision |
| `expectedOutcome` | `string` | Yes | The expected outcome of the decision |
| `outcomeEstimates` | `string[]` | No | An array of outcome estimates in JSON string format. For each estimate, the format is {"text": "A description of an outcome estimate", "probability": "0.50"} |
| `skillLuckWeight` | `string` | No | A number between 0 and 1 representing the weight of skill vs luck in the outcome |
| `monthsToNextReview` | `integer` | Yes | The number of months until the next review of the decision |

## 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": "decision_journal",
      },
    },
  },
)

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: "decision_journal-create-decision",
  arguments: {
    title: "Title",
    tags: ["Tags"],
  },
})
```

**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: "decision_journal-create-decision",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    decision_journal: { authProvisionId: "apn_xxxxxxx" },
    title: "Title",
    tags: ["Tags"],
  },
})

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": "decision_journal-create-decision",
    "configured_props": {
      "decision_journal": { "authProvisionId": "apn_xxxxxxx" },
      "title": "Title",
      "tags": ["Tags"]
    }
  }'
```

---

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