@xano/developer-mcp 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/api_docs/format.js +5 -2
- package/dist/index.js +44 -5
- package/dist/meta_api_docs/format.d.ts +5 -0
- package/dist/meta_api_docs/format.js +171 -0
- package/dist/meta_api_docs/index.d.ts +52 -0
- package/dist/meta_api_docs/index.js +111 -0
- package/dist/meta_api_docs/topics/agent.d.ts +2 -0
- package/dist/meta_api_docs/topics/agent.js +142 -0
- package/dist/meta_api_docs/topics/api.d.ts +2 -0
- package/dist/meta_api_docs/topics/api.js +176 -0
- package/dist/meta_api_docs/topics/apigroup.d.ts +2 -0
- package/dist/meta_api_docs/topics/apigroup.js +124 -0
- package/dist/meta_api_docs/topics/authentication.d.ts +2 -0
- package/dist/meta_api_docs/topics/authentication.js +61 -0
- package/dist/meta_api_docs/topics/branch.d.ts +2 -0
- package/dist/meta_api_docs/topics/branch.js +73 -0
- package/dist/meta_api_docs/topics/file.d.ts +2 -0
- package/dist/meta_api_docs/topics/file.js +70 -0
- package/dist/meta_api_docs/topics/function.d.ts +2 -0
- package/dist/meta_api_docs/topics/function.js +164 -0
- package/dist/meta_api_docs/topics/history.d.ts +2 -0
- package/dist/meta_api_docs/topics/history.js +149 -0
- package/dist/meta_api_docs/topics/mcp_server.d.ts +2 -0
- package/dist/meta_api_docs/topics/mcp_server.js +139 -0
- package/dist/meta_api_docs/topics/middleware.d.ts +2 -0
- package/dist/meta_api_docs/topics/middleware.js +156 -0
- package/dist/meta_api_docs/topics/realtime.d.ts +2 -0
- package/dist/meta_api_docs/topics/realtime.js +112 -0
- package/dist/meta_api_docs/topics/start.d.ts +2 -0
- package/dist/meta_api_docs/topics/start.js +107 -0
- package/dist/meta_api_docs/topics/table.d.ts +2 -0
- package/dist/meta_api_docs/topics/table.js +195 -0
- package/dist/meta_api_docs/topics/task.d.ts +2 -0
- package/dist/meta_api_docs/topics/task.js +165 -0
- package/dist/meta_api_docs/topics/tool.d.ts +2 -0
- package/dist/meta_api_docs/topics/tool.js +150 -0
- package/dist/meta_api_docs/topics/workflows.d.ts +2 -0
- package/dist/meta_api_docs/topics/workflows.js +131 -0
- package/dist/meta_api_docs/topics/workspace.d.ts +2 -0
- package/dist/meta_api_docs/topics/workspace.js +153 -0
- package/dist/meta_api_docs/types.d.ts +79 -0
- package/dist/meta_api_docs/types.js +4 -0
- package/dist/run_api_docs/format.d.ts +5 -0
- package/dist/run_api_docs/format.js +175 -0
- package/dist/run_api_docs/index.d.ts +52 -0
- package/dist/run_api_docs/index.js +90 -0
- package/dist/run_api_docs/topics/data.d.ts +2 -0
- package/dist/run_api_docs/topics/data.js +104 -0
- package/dist/run_api_docs/topics/history.d.ts +2 -0
- package/dist/run_api_docs/topics/history.js +93 -0
- package/dist/run_api_docs/topics/run.d.ts +2 -0
- package/dist/run_api_docs/topics/run.js +110 -0
- package/dist/run_api_docs/topics/session.d.ts +2 -0
- package/dist/run_api_docs/topics/session.js +166 -0
- package/dist/run_api_docs/topics/start.d.ts +2 -0
- package/dist/run_api_docs/topics/start.js +97 -0
- package/dist/run_api_docs/topics/workflows.d.ts +2 -0
- package/dist/run_api_docs/topics/workflows.js +140 -0
- package/package.json +1 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export const sessionDoc = {
|
|
2
|
+
topic: "session",
|
|
3
|
+
title: "Session Management",
|
|
4
|
+
description: `Sessions are active runtime execution contexts with isolated state. Each run execution creates a session that tracks the execution lifecycle, timing metrics, and results.
|
|
5
|
+
|
|
6
|
+
## Session States
|
|
7
|
+
- \`pending\`: Awaiting execution
|
|
8
|
+
- \`processing\`: Setting up execution environment
|
|
9
|
+
- \`running\`: Active execution in progress
|
|
10
|
+
- \`error\`: Execution failed
|
|
11
|
+
- \`complete\`: Execution finished successfully
|
|
12
|
+
|
|
13
|
+
## Access Levels
|
|
14
|
+
- \`private\`: Requires authentication and project ownership
|
|
15
|
+
- \`public\`: Accessible without authentication
|
|
16
|
+
|
|
17
|
+
## Session Lifecycle
|
|
18
|
+
1. **Creation**: Session created when a run is executed
|
|
19
|
+
2. **Execution**: Session progresses through states
|
|
20
|
+
3. **Hibernation**: Long-running services may hibernate after timeout
|
|
21
|
+
4. **Termination**: Sessions can be stopped manually or auto-cleanup
|
|
22
|
+
|
|
23
|
+
## Timing Metrics
|
|
24
|
+
Sessions track detailed timing information:
|
|
25
|
+
- \`boot_time\`: Environment setup time
|
|
26
|
+
- \`pre_time\`: Pre-execution processing
|
|
27
|
+
- \`main_time\`: Main execution duration
|
|
28
|
+
- \`post_time\`: Post-execution cleanup
|
|
29
|
+
- \`total_time\`: Complete execution time`,
|
|
30
|
+
ai_hints: `- Check session state before performing operations
|
|
31
|
+
- Only "service" type sessions can be re-executed with new documents
|
|
32
|
+
- Public sessions are accessible without auth - use for sharing results
|
|
33
|
+
- Sessions auto-hibernate after project timeout (default: 1 hour)
|
|
34
|
+
- Use /stop endpoint to gracefully terminate running sessions
|
|
35
|
+
- Cannot stop sessions already in "error" or "complete" state`,
|
|
36
|
+
endpoints: [
|
|
37
|
+
{
|
|
38
|
+
method: "GET",
|
|
39
|
+
path: "/project/{project_id}/run/session",
|
|
40
|
+
tool_name: "getProjectSessions",
|
|
41
|
+
description: "List all active sessions for a project with pagination.",
|
|
42
|
+
parameters: [
|
|
43
|
+
{ name: "project_id", type: "uuid", required: true, in: "path", description: "Project UUID" },
|
|
44
|
+
{ name: "page", type: "integer", default: 1, description: "Page number (min: 1)" }
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
method: "GET",
|
|
49
|
+
path: "/project/{project_id}/run/{run_id}/session",
|
|
50
|
+
tool_name: "getRunSessions",
|
|
51
|
+
description: "List all sessions for a specific run.",
|
|
52
|
+
parameters: [
|
|
53
|
+
{ name: "project_id", type: "uuid", required: true, in: "path", description: "Project UUID" },
|
|
54
|
+
{ name: "run_id", type: "uuid", required: true, in: "path", description: "Run UUID" },
|
|
55
|
+
{ name: "page", type: "integer", default: 1, description: "Page number (min: 1)" }
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
method: "GET",
|
|
60
|
+
path: "/session/{session_id}",
|
|
61
|
+
tool_name: "getSession",
|
|
62
|
+
description: "Get detailed information about a session including status, run config, and timing metrics. Public sessions don't require authentication.",
|
|
63
|
+
parameters: [
|
|
64
|
+
{ name: "session_id", type: "uuid", required: true, in: "path", description: "Session UUID" }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
method: "POST",
|
|
69
|
+
path: "/session/{session_id}/access",
|
|
70
|
+
tool_name: "setSessionAccess",
|
|
71
|
+
description: "Update the access level of a session (public or private).",
|
|
72
|
+
parameters: [
|
|
73
|
+
{ name: "session_id", type: "uuid", required: true, in: "path", description: "Session UUID" }
|
|
74
|
+
],
|
|
75
|
+
request_body: {
|
|
76
|
+
type: "application/json",
|
|
77
|
+
properties: {
|
|
78
|
+
access: { type: "enum", required: true, description: "Access level: 'public' or 'private'" }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
example: {
|
|
82
|
+
method: "POST",
|
|
83
|
+
path: "/session/session-uuid/access",
|
|
84
|
+
body: { access: "public" }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
method: "POST",
|
|
89
|
+
path: "/session/{session_id}/exec",
|
|
90
|
+
description: "Re-execute on an existing service session with a new XanoScript document. Reuses the session's resources (tenant). Only works on 'service' type sessions with a valid tenant.",
|
|
91
|
+
parameters: [
|
|
92
|
+
{ name: "session_id", type: "uuid", required: true, in: "path", description: "Session UUID" }
|
|
93
|
+
],
|
|
94
|
+
request_body: {
|
|
95
|
+
type: "application/json",
|
|
96
|
+
properties: {
|
|
97
|
+
doc: { type: "text", required: true, description: "New XanoScript document" },
|
|
98
|
+
args: { type: "json", description: "Arguments (default: {})" },
|
|
99
|
+
env: { type: "json", description: "Environment overrides (default: {})" }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
example: {
|
|
103
|
+
method: "POST",
|
|
104
|
+
path: "/session/session-uuid/exec",
|
|
105
|
+
body: {
|
|
106
|
+
doc: "job updated_logic {\n response = \"New execution on existing session\"\n}",
|
|
107
|
+
args: {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
method: "PATCH",
|
|
113
|
+
path: "/session/{session_id}",
|
|
114
|
+
tool_name: "updateSessionRun",
|
|
115
|
+
description: "Update the run name associated with a session.",
|
|
116
|
+
parameters: [
|
|
117
|
+
{ name: "session_id", type: "uuid", required: true, in: "path", description: "Session UUID" }
|
|
118
|
+
],
|
|
119
|
+
request_body: {
|
|
120
|
+
type: "application/json",
|
|
121
|
+
properties: {
|
|
122
|
+
name: { type: "text", required: true, description: "New run name (min 1 character)" }
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
method: "POST",
|
|
128
|
+
path: "/project/{project_id}/run/{run_id}/session/{session_id}/stop",
|
|
129
|
+
tool_name: "stopSession",
|
|
130
|
+
description: "Stop and tear down a running session. Creates a backup before deletion. Cannot stop sessions already in 'error' or 'complete' state.",
|
|
131
|
+
parameters: [
|
|
132
|
+
{ name: "project_id", type: "uuid", required: true, in: "path", description: "Project UUID" },
|
|
133
|
+
{ name: "run_id", type: "uuid", required: true, in: "path", description: "Run UUID" },
|
|
134
|
+
{ name: "session_id", type: "uuid", required: true, in: "path", description: "Session UUID" }
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
schemas: {
|
|
139
|
+
Session: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
id: { type: "uuid", description: "Session identifier" },
|
|
143
|
+
run_id: { type: "uuid", description: "Associated run" },
|
|
144
|
+
state: { type: "enum", enum: ["pending", "processing", "running", "error", "complete"], description: "Current state" },
|
|
145
|
+
access: { type: "enum", enum: ["private", "public"], description: "Access level" },
|
|
146
|
+
doc: { type: "text", description: "Executed XanoScript" },
|
|
147
|
+
version: { type: "integer", description: "Document version" },
|
|
148
|
+
response: { type: "json", description: "Execution response" },
|
|
149
|
+
error_msg: { type: "text", description: "Error message if failed" },
|
|
150
|
+
logs: { type: "json[]", description: "Execution logs" },
|
|
151
|
+
label: { type: "text", description: "Session label" },
|
|
152
|
+
tenant_id: { type: "integer", description: "Runtime tenant reference" },
|
|
153
|
+
hibernate_at: { type: "timestamp", description: "Hibernation timestamp" },
|
|
154
|
+
pre_time: { type: "decimal", description: "Pre-execution time" },
|
|
155
|
+
post_time: { type: "decimal", description: "Post-execution time" },
|
|
156
|
+
main_time: { type: "decimal", description: "Main execution time" },
|
|
157
|
+
boot_time: { type: "decimal", description: "Boot time" },
|
|
158
|
+
total_time: { type: "decimal", description: "Total execution time" },
|
|
159
|
+
backup: { type: "object", description: "Backup info with resource and size" },
|
|
160
|
+
created_at: { type: "timestamp", description: "Creation time" },
|
|
161
|
+
updated_at: { type: "timestamp", description: "Last update time" }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
related_topics: ["run", "data", "workflows"]
|
|
166
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const startDoc = {
|
|
2
|
+
topic: "start",
|
|
3
|
+
title: "Xano Run API - Getting Started",
|
|
4
|
+
description: `The Xano Run API provides programmatic access to execute XanoScript, manage runtime sessions, and work with execution environments. Use it to run scripts, manage long-running services, and retrieve execution history.
|
|
5
|
+
|
|
6
|
+
## Base URL
|
|
7
|
+
\`\`\`
|
|
8
|
+
https://app.dev.xano.com/api:run/<endpoint>
|
|
9
|
+
\`\`\`
|
|
10
|
+
|
|
11
|
+
**Important:** This is a fixed URL - NOT your Xano instance URL. All Run API requests go to this central endpoint.
|
|
12
|
+
|
|
13
|
+
## Authentication
|
|
14
|
+
Include your Access Token in the Authorization header:
|
|
15
|
+
\`\`\`
|
|
16
|
+
Authorization: Bearer <your-access-token>
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
Access tokens are created in the Xano dashboard under Settings > Access Tokens.
|
|
20
|
+
|
|
21
|
+
## Key Concepts
|
|
22
|
+
|
|
23
|
+
### Run Types
|
|
24
|
+
- **Job**: One-time execution that runs to completion and terminates
|
|
25
|
+
- **Service**: Long-running process that persists in a tenant until stopped
|
|
26
|
+
|
|
27
|
+
### Sessions
|
|
28
|
+
Sessions are active runtime execution contexts with isolated state. Each execution creates a session that tracks:
|
|
29
|
+
- Execution state (pending, processing, running, error, complete)
|
|
30
|
+
- Timing metrics (boot_time, main_time, total_time, etc.)
|
|
31
|
+
- Response data and logs
|
|
32
|
+
- Access level (public/private)
|
|
33
|
+
|
|
34
|
+
### Resource Hierarchy
|
|
35
|
+
\`\`\`
|
|
36
|
+
project/
|
|
37
|
+
└── run/ # Stored run configurations
|
|
38
|
+
└── session/ # Active execution contexts
|
|
39
|
+
└── backup/sink # Data snapshots
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
1. **Execute a script:** \`POST /project/{project_id}/run/exec\` with your XanoScript
|
|
44
|
+
2. **Check session status:** \`GET /session/{session_id}\`
|
|
45
|
+
3. **View run history:** \`GET /project/{project_id}/run\`
|
|
46
|
+
|
|
47
|
+
## Common Parameters
|
|
48
|
+
- \`project_id\`: UUID of your project (required for most endpoints)
|
|
49
|
+
- \`run_id\`: UUID of a stored run configuration
|
|
50
|
+
- \`session_id\`: UUID of an active session
|
|
51
|
+
- \`doc\`: XanoScript document content
|
|
52
|
+
- \`args\`: JSON arguments passed to the execution
|
|
53
|
+
- \`env\`: Environment variable overrides`,
|
|
54
|
+
ai_hints: `- Use \`POST /project/{id}/run/exec\` to execute new XanoScript
|
|
55
|
+
- Sessions are created automatically from executions
|
|
56
|
+
- Use "job" type for one-time tasks, "service" for long-running processes
|
|
57
|
+
- Check session state before operations (running, error, complete)
|
|
58
|
+
- Only "service" type sessions can be re-executed with new documents
|
|
59
|
+
- Use \`GET /session/{id}/sink\` to export all data after hibernation`,
|
|
60
|
+
related_topics: ["run", "session", "workflows"],
|
|
61
|
+
examples: [
|
|
62
|
+
{
|
|
63
|
+
title: "Execute a simple XanoScript",
|
|
64
|
+
description: "Run a XanoScript job and get the result",
|
|
65
|
+
request: {
|
|
66
|
+
method: "POST",
|
|
67
|
+
path: "/project/abc123-uuid/run/exec",
|
|
68
|
+
headers: { "Authorization": "Bearer <token>" },
|
|
69
|
+
body: {
|
|
70
|
+
doc: "job hello {\n response = \"Hello, World!\"\n}",
|
|
71
|
+
args: {},
|
|
72
|
+
template: "small"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
response: {
|
|
76
|
+
session_id: "session-uuid-here",
|
|
77
|
+
state: "complete",
|
|
78
|
+
response: "Hello, World!"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: "Check session status",
|
|
83
|
+
description: "Get details about a running or completed session",
|
|
84
|
+
request: {
|
|
85
|
+
method: "GET",
|
|
86
|
+
path: "/session/session-uuid-here",
|
|
87
|
+
headers: { "Authorization": "Bearer <token>" }
|
|
88
|
+
},
|
|
89
|
+
response: {
|
|
90
|
+
id: "session-uuid-here",
|
|
91
|
+
state: "running",
|
|
92
|
+
access: "private",
|
|
93
|
+
created_at: "2024-01-15T10:30:00Z"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export const workflowsDoc = {
|
|
2
|
+
topic: "workflows",
|
|
3
|
+
title: "Common Workflows",
|
|
4
|
+
description: `Step-by-step guides for common multi-step tasks using the Xano Run API.
|
|
5
|
+
|
|
6
|
+
## Quick Reference
|
|
7
|
+
- **Execute Script**: validate doc → execute → check session
|
|
8
|
+
- **Monitor Session**: list sessions → get details → check state
|
|
9
|
+
- **Export Data**: execute service → wait for hibernate → get sink
|
|
10
|
+
- **Re-execute**: get history → re-execute with overrides`,
|
|
11
|
+
ai_hints: `- Always validate scripts with doc/info before execution
|
|
12
|
+
- Monitor session state changes for long-running services
|
|
13
|
+
- Clean up unused sessions to conserve resources
|
|
14
|
+
- Use the fixed base URL: https://app.dev.xano.com/api:run/<endpoint>
|
|
15
|
+
- Sessions auto-hibernate after project timeout
|
|
16
|
+
- Export data via /sink only after hibernation`,
|
|
17
|
+
patterns: [
|
|
18
|
+
{
|
|
19
|
+
name: "Execute New XanoScript",
|
|
20
|
+
description: "Validate, execute, and monitor a XanoScript job",
|
|
21
|
+
steps: [
|
|
22
|
+
"1. `POST /project/{project_id}/doc/info` - Validate script structure",
|
|
23
|
+
"2. `POST /project/{project_id}/run/exec` - Execute the script",
|
|
24
|
+
"3. `GET /session/{session_id}` - Check execution status",
|
|
25
|
+
"4. (if running) Poll session until state is 'complete' or 'error'"
|
|
26
|
+
],
|
|
27
|
+
example: `// 1. Validate document
|
|
28
|
+
POST https://app.dev.xano.com/api:run/project/abc123/doc/info
|
|
29
|
+
{
|
|
30
|
+
"doc": "job process_data {\\n response = db.items.query().all()\\n}"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 2. Execute
|
|
34
|
+
POST https://app.dev.xano.com/api:run/project/abc123/run/exec
|
|
35
|
+
{
|
|
36
|
+
"doc": "job process_data {\\n response = db.items.query().all()\\n}",
|
|
37
|
+
"args": {},
|
|
38
|
+
"template": "small"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 3. Check status
|
|
42
|
+
GET https://app.dev.xano.com/api:run/session/{returned_session_id}`
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "Run a Persistent Service",
|
|
46
|
+
description: "Start a long-running service and manage its lifecycle",
|
|
47
|
+
steps: [
|
|
48
|
+
"1. `POST /project/{project_id}/run/exec` - Start service (type: service)",
|
|
49
|
+
"2. `GET /session/{session_id}` - Verify service is running",
|
|
50
|
+
"3. `POST /session/{session_id}/access` - Optionally make public",
|
|
51
|
+
"4. `POST /session/{session_id}/exec` - Re-execute with new code if needed",
|
|
52
|
+
"5. `POST /project/{project_id}/run/{run_id}/session/{session_id}/stop` - Stop when done"
|
|
53
|
+
],
|
|
54
|
+
example: `// 1. Start service
|
|
55
|
+
POST https://app.dev.xano.com/api:run/project/abc123/run/exec
|
|
56
|
+
{
|
|
57
|
+
"doc": "service my_api {\\n endpoint GET /hello {\\n response = 'Hello!'\\n }\\n}",
|
|
58
|
+
"args": {}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 2. Stop service when done
|
|
62
|
+
POST https://app.dev.xano.com/api:run/project/abc123/run/{run_id}/session/{session_id}/stop`
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "Export Session Data",
|
|
66
|
+
description: "Export all data from a session after hibernation",
|
|
67
|
+
steps: [
|
|
68
|
+
"1. Execute a run (job or service)",
|
|
69
|
+
"2. Wait for session to hibernate (auto or via stop)",
|
|
70
|
+
"3. `GET /session/{session_id}/sink` - Export all data"
|
|
71
|
+
],
|
|
72
|
+
example: `// 1. After session has run and hibernated
|
|
73
|
+
GET https://app.dev.xano.com/api:run/session/{session_id}/sink
|
|
74
|
+
|
|
75
|
+
// Response includes all tables and records as JSON`
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "Re-execute with Modified Arguments",
|
|
79
|
+
description: "Run an existing script again with different inputs",
|
|
80
|
+
steps: [
|
|
81
|
+
"1. `GET /project/{project_id}/run` - Get run history",
|
|
82
|
+
"2. Find the run_id you want to re-execute",
|
|
83
|
+
"3. `POST /project/{project_id}/run/{run_id}/exec` - Re-execute with new args"
|
|
84
|
+
],
|
|
85
|
+
example: `// 1. Get history
|
|
86
|
+
GET https://app.dev.xano.com/api:run/project/abc123/run
|
|
87
|
+
|
|
88
|
+
// 2. Re-execute with different args
|
|
89
|
+
POST https://app.dev.xano.com/api:run/project/abc123/run/{run_id}/exec
|
|
90
|
+
{
|
|
91
|
+
"args": {
|
|
92
|
+
"batch_size": 100,
|
|
93
|
+
"mode": "production"
|
|
94
|
+
}
|
|
95
|
+
}`
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "Monitor Active Sessions",
|
|
99
|
+
description: "List and monitor running sessions for a project",
|
|
100
|
+
steps: [
|
|
101
|
+
"1. `GET /project/{project_id}/run/session` - List all sessions",
|
|
102
|
+
"2. Filter by state (running, pending, etc.)",
|
|
103
|
+
"3. `GET /session/{session_id}` - Get details for specific session",
|
|
104
|
+
"4. Take action based on state (stop, re-execute, export)"
|
|
105
|
+
],
|
|
106
|
+
example: `// 1. List sessions
|
|
107
|
+
GET https://app.dev.xano.com/api:run/project/abc123/run/session?page=1
|
|
108
|
+
|
|
109
|
+
// 2. Check specific session
|
|
110
|
+
GET https://app.dev.xano.com/api:run/session/{session_id}
|
|
111
|
+
|
|
112
|
+
// 3. Stop if needed
|
|
113
|
+
POST https://app.dev.xano.com/api:run/project/abc123/run/{run_id}/session/{session_id}/stop`
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "Debug Failed Execution",
|
|
117
|
+
description: "Investigate why a run failed",
|
|
118
|
+
steps: [
|
|
119
|
+
"1. `GET /session/{session_id}` - Check session state and error_msg",
|
|
120
|
+
"2. Review the 'logs' field for execution details",
|
|
121
|
+
"3. `POST /project/{project_id}/doc/info` - Validate the script syntax",
|
|
122
|
+
"4. Fix issues and re-execute"
|
|
123
|
+
],
|
|
124
|
+
example: `// 1. Get session details
|
|
125
|
+
GET https://app.dev.xano.com/api:run/session/{session_id}
|
|
126
|
+
|
|
127
|
+
// Response includes:
|
|
128
|
+
// - state: "error"
|
|
129
|
+
// - error_msg: "Detailed error message"
|
|
130
|
+
// - logs: [...execution logs...]
|
|
131
|
+
|
|
132
|
+
// 2. Validate fixed script
|
|
133
|
+
POST https://app.dev.xano.com/api:run/project/abc123/doc/info
|
|
134
|
+
{
|
|
135
|
+
"doc": "job fixed_script {\\n // corrected code\\n}"
|
|
136
|
+
}`
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
related_topics: ["start", "run", "session", "data"]
|
|
140
|
+
};
|