Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
---
id: amazon-bedrock-codeinterpreter
sidebar_label: Amazon Bedrock Code Interpreter
title: Amazon Bedrock Code Interpreter connector
description: Execute Python code in a secure AWS Bedrock AgentCore sandbox from your BPMN process.
---

Execute Python code in a secure [Amazon Bedrock AgentCore Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html) sandbox from your BPMN process with the **Amazon Bedrock Code Interpreter** outbound connector.

## Prerequisites

To use the Amazon Bedrock Code Interpreter connector, you need the following:

- An AWS account with an access key and secret key, or a configured default credentials chain.
- IAM permissions to perform the following actions on the `bedrock-agentcore` service:
- `StartCodeInterpreterSession`
- `InvokeCodeInterpreter`
- `StopCodeInterpreterSession`
- The AgentCore Code Interpreter service must be available in your selected AWS region.

Learn more about the AgentCore Code Interpreter in the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html).

:::note
Use Camunda secrets to store credentials and avoid exposing sensitive information directly from the process. Refer to [managing secrets](/components/console/manage-clusters/manage-secrets.md) to learn more.
:::

## Create an Amazon Bedrock Code Interpreter connector task

import ConnectorTask from '../../../components/react-components/connector-task.md'

<ConnectorTask/>

## Authentication

To authenticate, select an authentication method from the **Authentication** dropdown. The supported options are:

- **Credentials**: Select this option if you have a valid pair of access and secret keys provided by your AWS account administrator.

:::note
This option is applicable for both SaaS and Self-Managed users.
:::

- **Default Credentials Chain**: Select this option if your system is configured as an implicit authentication mechanism, such as role-based authentication, credentials supplied via environment variables, or files on target host. This approach uses the [Default Credential Provider Chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html) to resolve required credentials.

:::note
This option is applicable only for Self-Managed or hybrid distributions.
:::

## Configuration

In the **Region** field, enter the AWS region where the Code Interpreter service is available (for example, `us-east-1`).

## Code execution

### Parameters

| Parameter | Required | Description |
| :------------------ | :------- | :---------------------------------------------------------------------------------------------------------------- |
| **Code** | Yes | The Python code to execute in the sandbox. Supports [FEEL](/components/modeler/feel/what-is-feel.md) expressions. |
| **Session timeout** | No | How long the sandbox session stays alive, in seconds (60–28,800). Defaults to 300. |

:::note
The session timeout controls how long the sandbox environment remains available, not how long the code takes to execute. Code execution typically completes in seconds.
:::

The sandbox environment includes common Python libraries such as `matplotlib`, `pandas`, `numpy`, and `csv`. Network access is not available from within the sandbox.

### Response

The connector returns the following fields:

| Field | Description |
| :---------------- | :------------------------------------------------------------------------------------------------------------------- |
| `stdout` | The standard output printed by the code. |
| `stderr` | Any error output produced during execution. |
| `exitCode` | The process exit code. A value of `0` indicates successful execution. |
| `executionTimeMs` | The execution duration in milliseconds. |
| `files` | A list of [Camunda documents](/components/document-handling/getting-started.md) for any files generated by the code. |

### File handling

Any files the code creates during execution are automatically detected and returned as Camunda documents in the `files` field. This includes images (for example, charts saved with `plt.savefig()`), CSV files, text files, and other output files.

:::note
A maximum of 10 files are retrieved per execution, with a total size limit of 10 MB. Files exceeding these limits are skipped, and a warning is logged.
:::

### Output mapping

1. Use **Result Variable** to store the response in a process variable. For example, `codeResult`.
2. Use **Result Expression** to map specific fields from the response into process variables.

For example, to extract the output and generated files:

```feel
= {
output: stdout,
files: files
}
```

### Example: Run a calculation

**Code:**

```python
total = sum([12000, 8500, 15000, 9200])
print(f"Total claims: ${total:,}")
```

**Response:**

```json
{
"stdout": "Total claims: $44,700\n",
"stderr": "",
"exitCode": 0,
"executionTimeMs": 0.05,
"files": []
}
```

### Example: Generate a chart

**Code:**

```python
import matplotlib.pyplot as plt
plt.bar(["Q1", "Q2", "Q3", "Q4"], [12000, 8500, 15000, 9200])
plt.title("Claims by Quarter")
plt.ylabel("Amount ($)")
plt.savefig("chart.png")
print("Chart saved")
```

**Response:**

```json
{
"stdout": "Chart saved\n",
"stderr": "",
"exitCode": 0,
"executionTimeMs": 1.67,
"files": [
{
"storeId": "in-memory",
"documentId": "851505b2-61bd-4717-9c86-07678b67f033",
"metadata": {
"contentType": "image/png",
"size": 14734,
"fileName": "chart.png"
},
"camunda.document.type": "camunda"
}
]
}
```

### Example: Generate a CSV report

**Code:**

```python
import csv
with open("claims.csv", "w", newline="") as f:
w = csv.writer(f)
w.writerow(["ClaimID", "Amount", "Status"])
w.writerows([["C001", 45000, "Rejected"], ["C002", 12000, "Approved"]])
print("Report created")
```

**Response:**

```json
{
"stdout": "Report created\n",
"stderr": "",
"exitCode": 0,
"executionTimeMs": 0.05,
"files": [
{
"storeId": "in-memory",
"documentId": "c209e3a4-cefa-4622-adc1-88c92bf06bb2",
"metadata": {
"contentType": "text/csv",
"size": 80,
"fileName": "claims.csv"
},
"camunda.document.type": "camunda"
}
]
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
id: amazon-bedrock-knowledgebase
sidebar_label: Amazon Bedrock Knowledge Base
title: Amazon Bedrock Knowledge Base connector
description: Perform semantic search over documents indexed in an Amazon Bedrock Knowledge Base from your BPMN process with the Amazon Bedrock Knowledge Base outbound connector.
---

Perform semantic search over documents indexed in an [Amazon Bedrock Knowledge Base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html) from your BPMN process with the **Amazon Bedrock Knowledge Base** outbound connector.

## Prerequisites

To use the Amazon Bedrock Knowledge Base connector, you need the following:

- An AWS account with an access key and secret key, or a configured default credentials chain.
- A [Bedrock Knowledge Base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-create.html) created and configured with at least one data source.
- IAM permissions to execute the [`Retrieve`](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html) action on the knowledge base.

Learn more about Amazon Bedrock Knowledge Bases in the [official documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html).

:::note
Use Camunda secrets to store credentials and avoid exposing sensitive information directly from the process. Refer to [managing secrets](/components/console/manage-clusters/manage-secrets.md) to learn more.
:::

## Create an Amazon Bedrock Knowledge Base connector task

import ConnectorTask from '../../../components/react-components/connector-task.md'

<ConnectorTask/>

## Authentication

To authenticate, select an authentication method from the **Authentication** dropdown. The supported options are:

- **Credentials**: Select this option if you have a valid pair of access and secret keys provided by your AWS account administrator. The access key must have permissions to the Bedrock Knowledge Base `Retrieve` action.

:::note
This option is applicable for both SaaS and Self-Managed users.
:::

- **Default Credentials Chain**: Select this option if your system is configured as an implicit authentication mechanism, such as role-based authentication, credentials supplied via environment variables, or files on target host. This approach uses the [Default Credential Provider Chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html) to resolve required credentials.

:::note
This option is applicable only for Self-Managed or hybrid distributions.
:::

## Configuration

In the **Region** field, enter the AWS region where your knowledge base is deployed (for example, `us-east-1`).

In the **Knowledge Base ID** field, enter the ID of the Bedrock Knowledge Base you want to query. You can find this ID in the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock/).

## Operations

The Amazon Bedrock Knowledge Base connector supports the following operations.

### Retrieve from knowledge base

Perform a semantic search over the documents indexed in your knowledge base. The connector returns the most relevant passages that match your query.

#### Parameters

| Parameter | Required | Description |
| :-------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------- |
| **Query** | Yes | A natural language query to search the knowledge base. Supports [FEEL](/components/modeler/feel/what-is-feel.md) expressions. |
| **Number of results** | No | The maximum number of results to return (1–100). Defaults to five. |

#### Response

The connector returns the following fields:

| Field | Description |
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resultsDocument` | A [Camunda document](/components/document-handling/getting-started.md) containing the full retrieval results as JSON. Each result includes the matched text, a relevance score, the source location, and any associated metadata. |
| `resultCount` | The number of results returned. |
| `paginationToken` | A token for retrieving additional results in subsequent requests. This value is `null` if there are no more results. |

#### Output mapping

1. Use **Result Variable** to store the response in a process variable. For example, `kbResult`.
2. Use **Result Expression** to map specific fields from the response into process variables.

For example, to extract the document and result count:

```feel
= {
results: resultsDocument,
count: resultCount
}
```

#### Query guidelines

For best results, use specific, descriptive queries rather than short keywords:

| Query | Quality | Why |
| :--------------------------------------------------------------- | :------ | :----------------------------------------------- |
| "What does the auto insurance policy cover for stolen vehicles?" | Good | Specific topic with clear intent. |
| "What are the exclusions for water damage in home insurance?" | Good | Targets a specific section and policy type. |
| "Coverage" | Poor | Too broad. Returns many loosely related results. |
| "Tell me everything about insurance" | Poor | Too vague. No specific topic to match against. |

:::tip
When using the connector as a tool in an [AI Agent subprocess](/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent-subprocess.md), the agent composes the query automatically based on the user's request. Use the `fromAi()` function to let the agent generate targeted queries.
:::

#### Example response

The following is an example of the JSON content stored in the `resultsDocument` document:

```json
{
"results": [
{
"content": "Comprehensive auto insurance covers damage to your vehicle from events other than collisions, including theft, vandalism, natural disasters, and falling objects.",
"score": 0.92,
"sourceUri": "s3://my-bucket/policies/auto-insurance.pdf",
"metadata": {
"category": "auto",
"policyType": "comprehensive"
}
},
{
"content": "Liability coverage pays for bodily injury and property damage that you cause to others in an auto accident.",
"score": 0.85,
"sourceUri": "s3://my-bucket/policies/auto-insurance.pdf",
"metadata": {
"category": "auto",
"policyType": "liability"
}
}
],
"nextToken": null
}
```
2 changes: 2 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@ module.exports = {
{
"Amazon AWS": [
"components/connectors/out-of-the-box-connectors/amazon-bedrock",
"components/connectors/out-of-the-box-connectors/amazon-bedrock-codeinterpreter",
"components/connectors/out-of-the-box-connectors/amazon-bedrock-knowledgebase",
"components/connectors/out-of-the-box-connectors/amazon-comprehend",
"components/connectors/out-of-the-box-connectors/amazon-dynamodb",
"components/connectors/out-of-the-box-connectors/amazon-eventbridge",
Expand Down
Loading