Skip to content
Merged
Show file tree
Hide file tree
Changes from 132 commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
dcb26ee
langflow-webhook-auth-enable
mendonk Oct 2, 2025
60ca49e
add-not-contains-filter-operator
mendonk Oct 2, 2025
8b8cf22
does-not-contains-operator
mendonk Oct 2, 2025
6ba6126
less-redundant-explanation
mendonk Oct 2, 2025
282165c
docs: add jq and path selection to data operations (#10083)
mendonk Oct 2, 2025
c64f9ef
Merge branch 'main' into docs-1.7-release
mendonk Oct 2, 2025
e8685bf
Merge branch 'main' into docs-1.7-release
mendonk Oct 6, 2025
f6d3a8b
smart transform historical names
aimurphy Oct 6, 2025
2643550
Merge branch 'main' into docs-1.7-release
aimurphy Oct 6, 2025
cea2d8b
change back to smart transform
aimurphy Oct 6, 2025
24ba1b6
jq expression capitalization/package name
aimurphy Oct 6, 2025
04afb78
small edit for clarity of not contains operator
aimurphy Oct 6, 2025
26897ab
Merge branch 'main' into docs-1.7-release
aimurphy Oct 6, 2025
9d35b93
read/write file component name changes
aimurphy Oct 6, 2025
71becc9
docs: add smart router component (#10097)
mendonk Oct 7, 2025
9374bf0
Merge branch 'main' into docs-1.7-release
mendonk Oct 7, 2025
10d293c
Merge branch 'main' into docs-1.7-release
mendonk Oct 7, 2025
47fc582
docs: screenshot audit (#10166)
mendonk Oct 9, 2025
d86cba8
docs: component paths updates for lfx (#10130)
mendonk Oct 14, 2025
5499647
docs: auto-add projects as MCP servers (#10096)
mendonk Oct 14, 2025
2f171e0
Merge branch 'main' into docs-1.7-release
mendonk Oct 15, 2025
845020d
Merge branch 'main' into docs-1.7-release
mendonk Oct 15, 2025
45bc439
docs: amazon bedrock converse (#10289)
mendonk Oct 15, 2025
653f2c8
docs 1.7 release: add mock data component (#10288)
mendonk Oct 15, 2025
4e467c5
Merge branch 'main' into docs-1.7-release
mendonk Oct 17, 2025
28a384c
Merge branch 'main' into docs-1.7-release
mendonk Oct 28, 2025
5e7eb83
docs: update custom component docs (#10323)
mendonk Oct 28, 2025
055f992
Merge branch 'main' into docs-1.7-release
mendonk Oct 29, 2025
9250a5f
docs: add cometapi back for 1.7 release (#10445)
mendonk Oct 29, 2025
83dc0fc
Merge branch 'main' into docs-1.7-release
mendonk Nov 3, 2025
e329cba
docs: add back docling remote vlm for release 1.7 (#10489)
mendonk Nov 3, 2025
514ef3c
Merge branch 'main' into docs-1.7-release
mendonk Nov 3, 2025
642edd3
Merge branch 'main' into docs-1.7-release
mendonk Nov 4, 2025
79d82bf
Merge branch 'main' into docs-1.7-release
mendonk Nov 5, 2025
280c699
Merge branch 'main' into docs-1.7-release
mendonk Nov 6, 2025
7e693dd
docs: ALTK component (#10511)
mendonk Nov 6, 2025
a9497ea
Merge branch 'main' into docs-1.7-release
mendonk Nov 10, 2025
a636eee
Merge branch 'main' into docs-1.7-release
mendonk Nov 12, 2025
10edcc8
docs: SSRF warning (#10573)
mendonk Nov 12, 2025
c11c434
docs: dynamic create data component (#10517)
mendonk Nov 13, 2025
d13fca7
Merge branch 'main' into docs-1.7-release
mendonk Nov 13, 2025
f11b7b1
Merge branch 'main' into docs-1.7-release
mendonk Nov 13, 2025
aefa976
docs: cuga component bundle (#10589)
mendonk Nov 17, 2025
2c24192
Merge branch 'main' into docs-1.7-release
mendonk Nov 17, 2025
001c312
Merge branch 'docs-1.7-release' of https://github.com/langflow-ai/lan…
mendonk Nov 17, 2025
8665757
Merge branch 'main' into docs-1.7-release
mendonk Nov 17, 2025
81ecaf2
Merge branch 'main' into docs-1.7-release
mendonk Nov 17, 2025
a6f5b21
docs: remove docling vlm component from 1.7 release branch (#10630)
mendonk Nov 18, 2025
b784aa8
docs: rename component categories and make all components single page…
mendonk Nov 19, 2025
f3d38a3
Merge branch 'main' into docs-1.7-release
mendonk Nov 19, 2025
6c58c1e
Merge branch 'main' into docs-1.7-release
mendonk Nov 19, 2025
8fa17ca
docs: combined web search component (#10664)
mendonk Nov 20, 2025
16c1176
docs: add altk reflection component (#10660)
mendonk Nov 20, 2025
7de255e
Merge branch 'main' into docs-1.7-release
mendonk Nov 20, 2025
c388162
Merge branch 'main' into docs-1.7-release
mendonk Nov 20, 2025
9e4b217
docs: mcp streamable http client (#10621)
mendonk Nov 21, 2025
db28db0
Merge branch 'main' into docs-1.7-release
mendonk Nov 21, 2025
5c84d8d
Merge branch 'main' into docs-1.7-release
mendonk Nov 21, 2025
1d49247
Merge branch 'main' into docs-1.7-release
mendonk Nov 21, 2025
5e9a449
Merge branch 'docs-1.7-release' of https://github.com/langflow-ai/lan…
mendonk Nov 21, 2025
13da761
docs: add cuga decomposition strategy as advanced parameter (#10672)
mendonk Nov 21, 2025
cb6fa13
docs: datastax bundles page (#10686)
mendonk Nov 24, 2025
931c2db
docs: llm router changed to llm selector (#10663)
mendonk Nov 24, 2025
2d434ff
Merge branch 'main' into docs-1.7-release
mendonk Nov 24, 2025
b5064e0
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 24, 2025
566b03b
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Nov 24, 2025
145c8a0
[autofix.ci] apply automated fixes (attempt 3/3)
autofix-ci[bot] Nov 24, 2025
76cb571
Merge branch 'main' into docs-1.7-release
mendonk Nov 24, 2025
af44766
docs: log alembic to stdout (#10711)
mendonk Nov 24, 2025
3ad76af
Merge branch 'main' into docs-1.7-release
mendonk Nov 25, 2025
ca3b93c
remove-legacy-component-link
mendonk Nov 25, 2025
f96ba98
docs: configure s3 for file storage backend (#10678)
mendonk Nov 25, 2025
cfe94fd
Merge branch 'main' into docs-1.7-release
mendonk Nov 25, 2025
ff88737
Merge branch 'main' into docs-1.7-release
mendonk Dec 1, 2025
49119f1
Merge branch 'main' into docs-1.7-release
mendonk Dec 2, 2025
f09e59c
Merge branch 'main' into docs-1.8-release
mendonk Dec 12, 2025
d0b179d
Merge branch 'main' into docs-1.8-release
mendonk Dec 29, 2025
7ccc8fc
Merge branch 'main' into docs-1.8-release
mendonk Jan 6, 2026
025bb8b
Merge branch 'main' into docs-1.8-release
mendonk Jan 7, 2026
3142b2e
docs: allow rest tweaks to mcp tools component (#10833)
mendonk Jan 7, 2026
a7c348c
Merge branch 'main' into docs-1.8-release
mendonk Jan 7, 2026
4529bc7
Merge branch 'main' into docs-1.8-release
mendonk Jan 8, 2026
89e2589
add-release-note
mendonk Jan 8, 2026
dac5862
Merge branch 'main' into docs-1.8-release
mendonk Jan 9, 2026
0ba3742
Merge branch 'main' into docs-1.8-release
mendonk Jan 13, 2026
beab013
Merge branch 'main' into docs-1.8-release
mendonk Jan 13, 2026
4ea2bac
Merge branch 'main' into docs-1.8-release
mendonk Jan 14, 2026
941337a
docs: use mustache templates in prompts (#11262)
mendonk Jan 14, 2026
612524b
Merge branch 'main' into docs-1.8-release
mendonk Jan 14, 2026
ad83cb3
docs: smart transform supports Message type (#11306)
mendonk Jan 14, 2026
5731c31
Merge branch 'main' into docs-1.8-release
mendonk Jan 15, 2026
5abf7e3
Merge branch 'main' into docs-1.8-release
mendonk Jan 15, 2026
0bd25ab
docs: modular dependency imports for langflow-base (#11250)
mendonk Jan 16, 2026
5e96170
Merge branch 'main' into docs-1.8-release
mendonk Jan 16, 2026
73c03a4
docs: symmetric and asymmetric JWT (#11159)
mendonk Jan 16, 2026
60fff6f
docs: add markdown output to url component (#11336)
mendonk Jan 20, 2026
fb2932a
Merge branch 'main' into docs-1.8-release
mendonk Jan 20, 2026
e6d8dcb
Merge branch 'main' into docs-1.8-release
mendonk Jan 20, 2026
771a552
Merge branch 'main' into docs-1.8-release
mendonk Jan 21, 2026
f02ac25
Merge branch 'main' into docs-1.8-release
mendonk Jan 22, 2026
cc4d0e2
docs: Add global variable support for MCP server headers (#11397)
mendonk Jan 22, 2026
d38ffd5
Merge branch 'main' into docs-1.8-release
mendonk Jan 22, 2026
63c034c
Merge branch 'main' into docs-1.8-release
mendonk Jan 22, 2026
6cdeab6
Update docs/docs/Develop/install-custom-dependencies.mdx
mendonk Jan 22, 2026
2c66ad7
Update docs/docs/Develop/jwt-authentication.mdx
mendonk Jan 22, 2026
eee04bc
Merge branch 'main' into docs-1.8-release
mendonk Jan 22, 2026
92ea645
Merge branch 'main' into docs-1.8-release
mendonk Jan 26, 2026
591859c
Merge branch 'main' into docs-1.8-release
mendonk Jan 27, 2026
ed45c91
Merge branch 'main' into docs-1.8-release
mendonk Jan 27, 2026
c6f4c24
Merge branch 'main' into docs-1.8-release
mendonk Jan 28, 2026
5737d84
Merge branch 'main' into docs-1.8-release
mendonk Feb 2, 2026
92adb19
Merge branch 'main' into docs-1.8-release
mendonk Feb 3, 2026
7e689a3
Merge branch 'main' into docs-1.8-release
mendonk Feb 4, 2026
0f7b3bf
Merge branch 'main' into docs-1.8-release
mendonk Feb 5, 2026
15af147
Merge branch 'main' into docs-1.8-release
mendonk Feb 5, 2026
99fb5c4
Merge branch 'main' into docs-1.8-release
mendonk Feb 6, 2026
cdacc17
Merge branch 'main' into docs-1.8-release
mendonk Feb 6, 2026
703bb8a
docs: global model provider feature (#11231)
mendonk Feb 9, 2026
1e80bba
Merge branch 'main' into docs-1.8-release
mendonk Feb 10, 2026
d3c9d8d
mustache-limitations
mendonk Feb 10, 2026
6aeae8e
release-note-for-jwt
mendonk Feb 10, 2026
eba4764
docs: playground refactor and screenshots (#11639)
mendonk Feb 10, 2026
d99eee6
docs: component inspection panel (#11675)
mendonk Feb 10, 2026
9a5885a
docs: add tool shortlisting and remove web_apps from CUGA component (…
mendonk Feb 10, 2026
64e4328
fix-details-tab-error
mendonk Feb 10, 2026
cfe78c7
docs: workflow API draft build (#11323)
mendonk Feb 10, 2026
9e545d2
Merge branch 'main' into docs-1.8-release
mendonk Feb 10, 2026
ca9dbf0
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 10, 2026
800b74e
docs: add guardrails component (#11674)
mendonk Feb 10, 2026
9fa5ad9
docs: pass env var to run command and endpoint as header (#11447)
mendonk Feb 10, 2026
e933faf
docs: responses api token usage tracking (#11564)
mendonk Feb 10, 2026
0e513a9
Merge branch 'main' into docs-1.8-release
mendonk Feb 11, 2026
ad457f6
Merge branch 'main' into docs-1.8-release
mendonk Feb 11, 2026
85e456b
changes-for-accessing-advanced-parameters
mendonk Feb 12, 2026
4e1b5a1
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 12, 2026
fb3ba4d
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Feb 12, 2026
484531b
small-playground-changes
mendonk Feb 12, 2026
ba0b18c
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 12, 2026
17062f3
Merge branch 'main' into docs-1.8-release
mendonk Feb 13, 2026
4a03060
Merge branch 'main' into docs-1.8-release
mendonk Feb 17, 2026
d1bc265
Merge branch 'main' into docs-1.8-release
mendonk Feb 18, 2026
ede17f3
Merge branch 'main' into docs-1.8-release
mendonk Feb 18, 2026
8c7fe82
Merge branch 'main' into docs-1.8-release
mendonk Feb 18, 2026
96a9c5a
Revert "docs: OpenAPI spec content updated without version change (#1…
mendonk Feb 18, 2026
5b6ba24
Merge branch 'main' into docs-1.8-release
mendonk Feb 23, 2026
a7f743a
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 23, 2026
321a38d
Merge branch 'main' into docs-1.8-release
mendonk Feb 26, 2026
e145385
Merge branch 'main' into docs-1.8-release
mendonk Feb 27, 2026
4866a72
Merge branch 'main' into docs-1.8-release
mendonk Mar 2, 2026
691b824
docs: add LiteLLM proxy bundle (#11867)
mendonk Mar 2, 2026
b013100
Merge branch 'main' into docs-1.8-release
mendonk Mar 2, 2026
661fa45
Merge branch 'main' into docs-1.8-release
mendonk Mar 2, 2026
12ed4e4
Merge branch 'main' into docs-1.8-release
mendonk Mar 3, 2026
af745d2
docs: 1.8 changes from QA (#11998)
mendonk Mar 3, 2026
cb7512c
docs: pass API keys to args and not env (#11997)
mendonk Mar 3, 2026
c91300f
docs: knowledge bases (#11924)
mendonk Mar 3, 2026
1649ee8
Merge branch 'main' into docs-1.8-release
mendonk Mar 3, 2026
357f885
docs: traces v0 (#12014)
mendonk Mar 3, 2026
bfa4356
Merge branch 'main' into docs-1.8-release
mendonk Mar 4, 2026
20a654f
Merge branch 'main' into docs-1.8-release
mendonk Mar 5, 2026
36ddd9c
docs: remove kb ingestion and rename kb retrieval (#12065)
mendonk Mar 5, 2026
c5d2079
docs: add link to secret key rotation script (#12072)
mendonk Mar 5, 2026
8c28e0e
docs: openlayer follow-on (#12073)
mendonk Mar 5, 2026
5c9f7eb
Merge branch 'main' into docs-1.8-release
mendonk Mar 5, 2026
7e34858
Merge branch 'main' into docs-1.8-release
mendonk Mar 5, 2026
aee7f51
Merge branch 'main' into docs-1.8-release
mendonk Mar 6, 2026
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
333 changes: 329 additions & 4 deletions docs/docs/API-Reference/api-flows-run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: Flow trigger endpoints
slug: /api-flows-run
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Use the `/run` and `/webhook` endpoints to run flows.

To create, read, update, and delete flows, see [Flow management endpoints](/api-flows).
Expand All @@ -20,6 +23,67 @@ Flow IDs can be found on the code snippets on the [**API access** pane](/concept
The following example runs the **Basic Prompting** template flow with flow parameters passed in the request body.
This flow requires a chat input string (`input_value`), and uses default values for all other parameters.

<Tabs>
<TabItem value="Python" label="Python" default>

```python
import requests

url = "http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID"

# Request payload
payload = {
"input_value": "Tell me about something interesting!",
"session_id": "chat-123",
"input_type": "chat",
"output_type": "chat",
"output_component": ""
}

# Request headers
headers = {
"Content-Type": "application/json",
"x-api-key": "LANGFLOW_API_KEY"
}

try:
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
print(response.json())
except requests.exceptions.RequestException as e:
print(f"Error making API request: {e}")
```

</TabItem>
<TabItem value="JavaScript" label="JavaScript">

```js
const payload = {
input_value: "Tell me about something interesting!",
session_id: "chat-123",
input_type: "chat",
output_type: "chat",
output_component: ""
};

const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'LANGFLOW_API_KEY'
},
body: JSON.stringify(payload)
};

fetch('http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID', options)
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
```

</TabItem>
<TabItem value="curl" label="curl">

```bash
curl -X POST \
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID" \
Expand All @@ -30,11 +94,13 @@ curl -X POST \
"session_id": "chat-123",
"input_type": "chat",
"output_type": "chat",
"output_component": "",
"tweaks": null
"output_component": ""
}'
```

</TabItem>
</Tabs>

The response from `/v1/run/$FLOW_ID` includes metadata, inputs, and outputs for the run.

<details>
Expand Down Expand Up @@ -84,6 +150,77 @@ With `/v1/run/$FLOW_ID`, the flow is executed as a batch with optional LLM token

To stream LLM token responses, append the `?stream=true` query parameter to the request:

<Tabs>
<TabItem value="Python" label="Python" default>

```python
import requests

url = "http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID?stream=true"

# Request payload
payload = {
"message": "Tell me something interesting!",
"session_id": "chat-123"
}

# Request headers
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"x-api-key": "LANGFLOW_API_KEY"
}

try:
response = requests.post(url, json=payload, headers=headers, stream=True)
response.raise_for_status()

# Process streaming response
for line in response.iter_lines():
if line:
print(line.decode('utf-8'))
except requests.exceptions.RequestException as e:
print(f"Error making API request: {e}")
```

</TabItem>
<TabItem value="JavaScript" label="JavaScript">

```js
const payload = {
message: "Tell me something interesting!",
session_id: "chat-123"
};

const options = {
method: 'POST',
headers: {
'accept': 'application/json',
'Content-Type': 'application/json',
'x-api-key': 'LANGFLOW_API_KEY'
},
body: JSON.stringify(payload)
};

fetch('http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID?stream=true', options)
.then(async response => {
const reader = response.body?.getReader();
const decoder = new TextDecoder();

if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
}
})
.catch(err => console.error(err));
```

</TabItem>
<TabItem value="curl" label="curl">

```bash
curl -X POST \
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID?stream=true" \
Expand All @@ -96,6 +233,9 @@ curl -X POST \
}'
```

</TabItem>
</Tabs>

LLM chat responses are streamed back as `token` events, culminating in a final `end` event that closes the connection.

<details>
Expand Down Expand Up @@ -132,8 +272,9 @@ The following example is truncated to illustrate a series of `token` events as w
| Header | Info | Example |
|--------|------|---------|
| Content-Type | Required. Specifies the JSON format. | "application/json" |
| accept | Optional. Specifies the response format. | "application/json" |
| x-api-key | Optional. Required only if authentication is enabled. | "sk-..." |
| accept | Optional. Specifies the response format. Defaults to JSON if not specified. | "application/json" |
| x-api-key | Required. Your Langflow API key for authentication. Can be passed as a header or query parameter. | "sk-..." |
| `X-LANGFLOW-GLOBAL-VAR-*` | Optional. Pass global variables to the flow. Variable names are automatically converted to uppercase. These variables take precedence over OS environment variables and are only available during this specific request execution. | `"X-LANGFLOW-GLOBAL-VAR-API_KEY: sk-..."` |

### Run endpoint parameters

Expand All @@ -150,6 +291,93 @@ The following example is truncated to illustrate a series of `token` events as w

### Request example with all headers and parameters

<Tabs>
<TabItem value="Python" label="Python" default>

```python
import requests

url = "http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID?stream=true"

# Request payload with tweaks
payload = {
"input_value": "Tell me a story",
"input_type": "chat",
"output_type": "chat",
"output_component": "chat_output",
"session_id": "chat-123",
"tweaks": {
"component_id": {
"parameter_name": "value"
}
}
}

# Request headers
headers = {
"Content-Type": "application/json",
"accept": "application/json",
"x-api-key": "LANGFLOW_API_KEY"
}

try:
response = requests.post(url, json=payload, headers=headers, stream=True)
response.raise_for_status()

# Process streaming response
for line in response.iter_lines():
if line:
print(line.decode('utf-8'))
except requests.exceptions.RequestException as e:
print(f"Error making API request: {e}")
```

</TabItem>
<TabItem value="JavaScript" label="JavaScript">

```js
const payload = {
input_value: "Tell me a story",
input_type: "chat",
output_type: "chat",
output_component: "chat_output",
session_id: "chat-123",
tweaks: {
component_id: {
parameter_name: "value"
}
}
};

const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'accept': 'application/json',
'x-api-key': 'LANGFLOW_API_KEY'
},
body: JSON.stringify(payload)
};

fetch('http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID?stream=true', options)
.then(async response => {
const reader = response.body?.getReader();
const decoder = new TextDecoder();

if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
}
})
.catch(err => console.error(err));
```

</TabItem>
<TabItem value="curl" label="curl">

```bash
curl -X POST \
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID?stream=true" \
Expand All @@ -170,6 +398,103 @@ curl -X POST \
}'
```

</TabItem>
</Tabs>

### Pass global variables in request headers {#pass-global-variables-in-headers}

You can pass global variables to your flow using HTTP headers with the format `X-LANGFLOW-GLOBAL-VAR-{VARIABLE_NAME}`.

Variables passed in headers take precedence over OS environment variables. If a variable is provided in both a header and an environment variable, the header value is used. Variables are only available during this specific request execution and aren't persisted.

Variable names are automatically converted to uppercase. For example, `X-LANGFLOW-GLOBAL-VAR-api-key` becomes `API_KEY` in your flow.

You don't need to create these variables in Langflow's Global Variables section first. Pass any variable name using this header format.

<Tabs>
<TabItem value="Python" label="Python" default>

```python
import requests

url = "http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID"

# Request payload
payload = {
"input_value": "Tell me about something interesting!",
"input_type": "chat",
"output_type": "chat"
}

# Request headers with global variables
headers = {
"Content-Type": "application/json",
"x-api-key": "LANGFLOW_API_KEY",
"X-LANGFLOW-GLOBAL-VAR-OPENAI_API_KEY": "sk-...",
"X-LANGFLOW-GLOBAL-VAR-USER_ID": "user123",
"X-LANGFLOW-GLOBAL-VAR-ENVIRONMENT": "production"
}

try:
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
print(response.json())
except requests.exceptions.RequestException as e:
print(f"Error making API request: {e}")
```

</TabItem>
<TabItem value="JavaScript" label="JavaScript">

```js
const payload = {
input_value: "Tell me about something interesting!",
input_type: "chat",
output_type: "chat"
};

const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'LANGFLOW_API_KEY',
'X-LANGFLOW-GLOBAL-VAR-OPENAI_API_KEY': 'sk-...',
'X-LANGFLOW-GLOBAL-VAR-USER_ID': 'user123',
'X-LANGFLOW-GLOBAL-VAR-ENVIRONMENT': 'production'
},
body: JSON.stringify(payload)
};

fetch('http://LANGFLOW_SERVER_URL/api/v1/run/FLOW_ID', options)
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
```

</TabItem>
<TabItem value="curl" label="curl">

```bash
curl -X POST \
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID" \
-H "Content-Type: application/json" \
-H "x-api-key: $LANGFLOW_API_KEY" \
-H "X-LANGFLOW-GLOBAL-VAR-OPENAI_API_KEY: sk-..." \
-H "X-LANGFLOW-GLOBAL-VAR-USER_ID: user123" \
-H "X-LANGFLOW-GLOBAL-VAR-ENVIRONMENT: production" \
-d '{
"input_value": "Tell me about something interesting!",
"input_type": "chat",
"output_type": "chat"
}'
```

</TabItem>
</Tabs>

If your flow components reference variables that aren't provided in headers or your Langflow database, the flow fails by default. To avoid this, you can set `LANGFLOW_FALLBACK_TO_ENV_VAR=True` in your `.env` file, which allows the flow to use values from OS environment variables if they aren't otherwise specified.


## Webhook run flow

Use the `/webhook` endpoint to start a flow by sending an HTTP `POST` request.
Expand Down
Loading
Loading