> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud Deployment

> Deploy graphs to persistent endpoints for production use

Once you've successfully [built your graph](/node/core-concepts/overview), you can deploy it to Inworld Cloud using the [Inworld Runtime CLI](/node/cli/overview) to create a persistent, production-ready endpoint.

Deploying your graph is ideal if:

* You're building in a language other than Node.js and want to use your graph through a hosted API endpoint
* You don't want to manage graph execution directly and prefer a cloud-managed deployment that scales automatically.

## Deploy your graph

To deploy your graph, you'll need to have the [Inworld Runtime CLI](/node/cli/overview) installed.

Once installed, run the following command with the path to your graph file (for example, `graph.ts`). Once deployment completes, you’ll see the persistent endpoint URL printed in your console output.

```bash theme={"system"}
inworld-runtime deploy ./graph.ts
```

You can use the following command-line flags to check on your deployment status and package your graph up for deployment without actually deploying.

| **Command**                          | **Description**                                                                                              |
| :----------------------------------- | :----------------------------------------------------------------------------------------------------------- |
| `--info`                             | Check deployment information, status, and health metrics for an existing deployment                          |
| `--package-only`                     | Package graph for deployment without actually deploying (creates graph-deployment.zip in current directory)  |
| `--package-only ./my-deployment.zip` | Package graph for deployment without actually deploying (creates graph-deployment.zip in custom output path) |

Once deployed, your clients can integrate with the persistent endpoint. Below is an example integration:

<CodeGroup>
  ```javascript JavaScript theme={"system"}
  // Client code (never needs to change)
  const response = await fetch('https://api.inworld.ai/cloud/workspaces/workspace-123/graphs/my-graph-id/v1/graph:start', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Basic YOUR_BASE64_API_KEY'
    },
    body: JSON.stringify({
      input: {
        user_input: "Hello!"
      },
      userContext: {
        targetingKey: "user123",
        attributes: { tier: "premium" }
      }
    })
  });
  ```

  ```bash cURL theme={"system"}
  curl -X POST https://api.inworld.ai/cloud/workspaces/workspace-123/graphs/my-graph-id/v1/graph:start \
    -H "Authorization: Basic $(inworld-runtime auth print-api-key)" \
    -H "Content-Type: application/json" \
    -d '{
      "input": {
        "user_input": "Hello!"
      },
      "userContext": {
        "targetingKey": "user123",
        "attributes": { "tier": "premium" }
      }
    }'
  ```
</CodeGroup>

Both methods will return a JSON response that you can process:

```javascript theme={"system"}
const result = await response.json();
console.log(result.output);
```

<Tip> You can update your graph anytime with `inworld-runtime deploy ./graph.ts` and clients automatically get the improvements without any code changes on their end. </Tip>

## How it works

When you deploy a graph, Inworld creates a **persistent endpoint** - a stable URL that your clients can integrate with once. Here's how it works:

* **Initial deployment**: Creates the endpoint (e.g., `https://api.inworld.ai/cloud/workspaces/[workspace-id]/graphs/[graph-id]/v1/graph`)
* **Subsequent deployments**: Update the graph behind the same endpoint
* **Client experience**: No changes needed - requests continue to work seamlessly
* **Zero downtime**: Updates happen instantly without service interruption

## Best practices

1. **Test locally first**: Always test your graph with `inworld-runtime serve` before deploying
2. **Package and inspect**: Use `--package-only` to review what will be deployed
3. **Deploy to cloud**: Use the basic deploy command to create your persistent endpoint
4. **Verify deployment**: Use `--info` to check deployment status and details

<Note> **Having issues?** Check the [CLI Troubleshooting Guide](/node/cli/troubleshooting) for comprehensive setup, development, and deployment troubleshooting. </Note>

## Next steps

Once your graph is deployed to the cloud:

<CardGroup cols={3}>
  <Card title="Set up Experiments" icon="flask" href="/node/cli/overview#a%2Fb-testing-%26-experimentation">
    A/B test different graph variants
  </Card>

  <Card title="Monitor Dashboards" icon="chart-line" href="/portal/dashboards">
    Monitor your key metrics
  </Card>

  <Card title="Explore Traces" icon="diagram-project" href="/portal/dashboards">
    Understand and debug your graph executions
  </Card>
</CardGroup>
