@devries-cameron20 / composio-1 / commits / fba1279ff
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: add LangGraph and Cloudflare Workers AI provider pages

LangGraph: Python-only, uses create_agent + invoke pattern. Cloudflare: TS-only (JS code block since @cloudflare/workers-types crashes the docs type checker), Workers AI function calling with agentic loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 17, 2026 at 17:52 UTC fba1279ffa9c548de10584eb92b4c0fbd6ce174d
3 files changed +154
docs/content/docs/providers/cloudflare.mdx new
+99
@@ -0,0 +1,99 @@
1 +---
2 +title: Cloudflare Workers AI
3 +description: Build an agent with Cloudflare Workers AI and enable it to use 800+ tools with Composio.
4 +keywords: [cloudflare, workers ai]
5 +---
6 +
7 +The Cloudflare provider transforms Composio tools into Cloudflare Workers AI's [function calling format](https://developers.cloudflare.com/workers-ai/function-calling/) with manual tool execution.
8 +
9 +<Steps>
10 +<Step>
11 +**Install**
12 +
13 +```bash
14 +npm install @composio/core @composio/cloudflare
15 +```
16 +</Step>
17 +
18 +<Step>
19 +**Configure API Keys**
20 +
21 +<Callout type="info">
22 +Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings). Your Cloudflare Worker has access to AI via the `env.AI` binding.
23 +</Callout>
24 +
25 +Add `COMPOSIO_API_KEY` to your Worker's environment variables in `wrangler.toml` or via the Cloudflare dashboard.
26 +
27 +```toml title="wrangler.toml"
28 +[vars]
29 +COMPOSIO_API_KEY = "xxxxxxxxx"
30 +```
31 +</Step>
32 +
33 +<Step>
34 +**Create session and run**
35 +
36 +```js
37 +import { Composio } from "@composio/core";
38 +import { CloudflareProvider } from "@composio/cloudflare";
39 +
40 +export default {
41 + async fetch(request, env) {
42 + const composio = new Composio({
43 + apiKey: env.COMPOSIO_API_KEY,
44 + provider: new CloudflareProvider(),
45 + });
46 +
47 + // Create a session for your user
48 + const session = await composio.create("user_123");
49 + const tools = await session.tools();
50 +
51 + const toolsArray = Object.values(tools);
52 +
53 + let response = await env.AI.run("@cf/meta/llama-4-scout-17b-16e-instruct", {
54 + messages: [
55 + {
56 + role: "user",
57 + content:
58 + "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'",
59 + },
60 + ],
61 + tools: toolsArray,
62 + });
63 +
64 + // Agentic loop — keep executing tool calls until the model responds with text
65 + while (response.tool_calls && response.tool_calls.length > 0) {
66 + const toolResults = [];
67 + for (const toolCall of response.tool_calls) {
68 + const result = await composio.provider.executeToolCall(
69 + "user_123",
70 + { name: toolCall.name, arguments: toolCall.arguments },
71 + {}
72 + );
73 + toolResults.push({
74 + role: "tool",
75 + tool_call_id: toolCall.name,
76 + content: result,
77 + });
78 + }
79 +
80 + response = await env.AI.run("@cf/meta/llama-4-scout-17b-16e-instruct", {
81 + messages: [
82 + {
83 + role: "user",
84 + content:
85 + "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'",
86 + },
87 + { role: "assistant", content: "", tool_calls: response.tool_calls },
88 + ...toolResults,
89 + ],
90 + tools: toolsArray,
91 + });
92 + }
93 +
94 + return new Response(response.response ?? "No response");
95 + },
96 +};
97 +```
98 +</Step>
99 +</Steps>
docs/content/docs/providers/langgraph.mdx new
+53
@@ -0,0 +1,53 @@
1 +---
2 +title: LangGraph
3 +description: Build an agent with LangGraph and enable it to use 800+ tools with Composio.
4 +keywords: [langgraph]
5 +---
6 +
7 +The LangGraph provider transforms Composio tools into LangChain's [StructuredTool](https://python.langchain.com/docs/how_to/custom_tools/) format for use with [LangGraph](https://langchain-ai.github.io/langgraph/) agents.
8 +
9 +<Steps>
10 +<Step>
11 +**Install**
12 +
13 +```bash
14 +pip install composio composio_langgraph langgraph langchain_openai
15 +```
16 +</Step>
17 +
18 +<Step>
19 +**Configure API Keys**
20 +
21 +<Callout type="info">
22 +Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/api-keys).
23 +</Callout>
24 +
25 +```txt title=".env"
26 +COMPOSIO_API_KEY=xxxxxxxxx
27 +OPENAI_API_KEY=xxxxxxxxx
28 +```
29 +</Step>
30 +
31 +<Step>
32 +**Create session and run**
33 +
34 +```python
35 +from composio import Composio
36 +from composio_langgraph import LanggraphProvider
37 +from langchain.agents import create_agent
38 +from langchain_openai import ChatOpenAI
39 +
40 +composio = Composio(provider=LanggraphProvider())
41 +llm = ChatOpenAI(model="gpt-5.2")
42 +
43 +# Create a session for your user
44 +session = composio.create(user_id="user_123")
45 +tools = session.tools()
46 +
47 +agent = create_agent(tools=tools, model=llm)
48 +result = agent.invoke({"messages": [("user", "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'")]})
49 +
50 +print(result["messages"][-1].content)
51 +```
52 +</Step>
53 +</Steps>
docs/content/docs/providers/meta.json
+2
@@ -5,11 +5,13 @@
5 "anthropic",
6 "vercel",
7 "langchain",
8 + "langgraph",
9 "mastra",
10 "openai",
11 "google",
12 "llamaindex",
13 "crewai",
14 + "cloudflare",
15 "custom-providers"
16 ]
17 }