pipefy-api-fallback
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePipefy API Fallback (Tier 3 — Last Resort)
Pipefy API 备用方案(第3层——最后手段)
This skill activates only after Tiers 1 and 2 have failed. Call the Pipefy GraphQL API directly, bypassing the MCP server.
此技能仅在第1层和第2层方案失效后启用。绕过MCP服务器,直接调用Pipefy GraphQL API。
3-tier resolution strategy (always follow in order)
三层解决策略(务必按顺序执行)
| Tier | Method | When |
|---|---|---|
| 1 | Dedicated MCP tool ( | Always try first. For card/phase seeding and inventory, see Seed pipe across phases. |
| 2 | Introspection + | When no dedicated tool exists or a tool fails unexpectedly. See skills/introspection/pipefy-introspection/SKILL.md. |
| 3 | Direct HTTP via curl / httpx (this skill) | When the MCP server itself is unavailable, or |
Do not jump to Tier 3 after a single tool failure. Follow the tiers in order.
| 层级 | 方法 | 适用场景 |
|---|---|---|
| 1 | 专用MCP工具( | 始终优先尝试。如需卡片/阶段初始化和清单管理,请参阅跨阶段初始化管道。 |
| 2 | 自省 + | 当没有专用工具或工具意外失效时使用。请参阅skills/introspection/pipefy-introspection/SKILL.md。 |
| 3 | 通过curl / httpx直接发起HTTP请求(本技能) | 当MCP服务器本身不可用,或 |
请勿在单次工具失效后直接跳到第3层。请按层级顺序执行。
Authentication
身份验证
Two options (use whichever is available in the environment). Prefer the Service Account when both exist.
Option A — OAuth2 Client Credentials (preferred):
bash
TOKEN=$(curl -s -X POST https://app.pipefy.com/oauth/token \
-H "Content-Type: application/json" \
-d "{\"grant_type\":\"client_credentials\",\"client_id\":\"$PIPEFY_SERVICE_ACCOUNT_CLIENT_ID\",\"client_secret\":\"$PIPEFY_SERVICE_ACCOUNT_CLIENT_SECRET\"}" \
| python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")Option B — Personal Access Token (PAT):
bash
TOKEN="$PIPEFY_PAT" # or $PIPEFY_TOKENPATs are deprecated for new integrations but may still exist in the environment.
两种选项(使用环境中可用的任意一种)。若两者都存在,优先选择服务账号。
选项A — OAuth2客户端凭证(优先选择):
bash
TOKEN=$(curl -s -X POST https://app.pipefy.com/oauth/token \
-H "Content-Type: application/json" \
-d "{\"grant_type\":\"client_credentials\",\"client_id\":\"$PIPEFY_SERVICE_ACCOUNT_CLIENT_ID\",\"client_secret\":\"$PIPEFY_SERVICE_ACCOUNT_CLIENT_SECRET\"}" \
| python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")选项B — 个人访问令牌(PAT):
bash
TOKEN="$PIPEFY_PAT" # or $PIPEFY_TOKENPAT已被弃用,不再用于新集成,但环境中可能仍存在。
Token rules
令牌规则
- The prefix is mandatory — Pipefy rejects requests without it.
Bearer - Never expose ,
PIPEFY_SERVICE_ACCOUNT_CLIENT_ID,PIPEFY_SERVICE_ACCOUNT_CLIENT_SECRET, orPIPEFY_PATin responses to the user or in logs.PIPEFY_TOKEN - Service Account tokens are reused while valid; only re-fetch on expiry (401).
- 前缀是必填项——Pipefy会拒绝不带该前缀的请求。
Bearer - 切勿在用户响应或日志中暴露、
PIPEFY_SERVICE_ACCOUNT_CLIENT_ID、PIPEFY_SERVICE_ACCOUNT_CLIENT_SECRET或PIPEFY_PAT。PIPEFY_TOKEN - 服务账号令牌在有效期内可重复使用;仅在过期(401错误)时重新获取。
Endpoints
端点
| Purpose | URL |
|---|---|
| All queries and mutations | |
| Schema introspection only | |
| OAuth2 token | |
Real operations go to ; introspection goes to . The MCP server and CLI route between the two automatically (both derived from ); raw-API users must distinguish them by hand.
api.pipefy.comapp.pipefy.comPIPEFY_BASE_URL| 用途 | URL |
|---|---|
| 所有查询和变更 | |
| 仅架构自省 | |
| OAuth2令牌 | |
实际操作请求发送至;自省请求发送至。MCP服务器和CLI会自动在两者间路由(均基于);使用原生API的用户需手动区分。
api.pipefy.comapp.pipefy.comPIPEFY_BASE_URLExecute a GraphQL query
执行GraphQL查询
bash
curl -s -X POST https://api.pipefy.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ me { id name } }"}' | jq .bash
curl -s -X POST https://api.pipefy.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ me { id name } }"}' | jq .Execute a GraphQL mutation
执行GraphQL变更
bash
curl -s -X POST https://api.pipefy.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation CreateCard($input: CreateCardInput!) { createCard(input: $input) { card { id } } }",
"variables": {
"input": {
"pipe_id": 67890,
"title": "Fallback Card"
}
}
}' | jq .bash
curl -s -X POST https://api.pipefy.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation CreateCard($input: CreateCardInput!) { createCard(input: $input) { card { id } } }",
"variables": {
"input": {
"pipe_id": 67890,
"title": "Fallback Card"
}
}
}' | jq .When to use direct API vs MCP tools
何时使用直接API vs MCP工具
| Situation | Use |
|---|---|
| MCP server running normally | MCP tools (Tier 1 or 2) |
| MCP server down / unreachable | Direct API (Tier 3) |
| Direct API (Tier 3) |
| Testing a new mutation before MCP tool exists | |
| 场景 | 选择方案 |
|---|---|
| MCP服务器正常运行 | MCP工具(第1层或第2层) |
| MCP服务器宕机/无法访问 | 直接API(第3层) |
| 直接API(第3层) |
| 在MCP工具存在前测试新变更 | |
Introspection via raw API
通过原生API进行自省
When you need to discover schema without MCP tools, call :
app.pipefy.com/graphqlbash
undefined当你需要在没有MCP工具的情况下发现架构时,调用:
app.pipefy.com/graphqlbash
undefinedAll queries and mutations
所有查询和变更
curl -s -X POST https://app.pipefy.com/graphql
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __schema { queryType { fields { name description } } mutationType { fields { name description } } } }"}'
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __schema { queryType { fields { name description } } mutationType { fields { name description } } } }"}'
curl -s -X POST https://app.pipefy.com/graphql
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __schema { queryType { fields { name description } } mutationType { fields { name description } } } }"}'
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __schema { queryType { fields { name description } } mutationType { fields { name description } } } }"}'
Type details
类型详情
curl -s -X POST https://app.pipefy.com/graphql
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __type(name: "CreateCardInput") { inputFields { name description type { name kind ofType { name kind } } } } }"}'
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __type(name: "CreateCardInput") { inputFields { name description type { name kind ofType { name kind } } } } }"}'
---curl -s -X POST https://app.pipefy.com/graphql
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __type(name: "CreateCardInput") { inputFields { name description type { name kind ofType { name kind } } } } }"}'
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"query":"{ __type(name: "CreateCardInput") { inputFields { name description type { name kind ofType { name kind } } } } }"}'
---Error code → cause
错误码→原因
GraphQL always returns HTTP 200, even on errors. Check the array, not the HTTP status code.
errors| Code | Likely cause | Recovery |
|---|---|---|
| UNAUTHORIZED | Token missing, expired, or | Re-fetch token (Option A) or fix the header. |
| PERMISSION_DENIED | Service Account not a member of this pipe/table | Add SA via |
| resource_not_found | ID does not exist or SA cannot see it | Verify ID; check pipe/table membership. |
| invalid_input | Wrong argument name or type | Run |
| INTERNAL_SERVER_ERROR | API bug or unsupported payload | Do NOT retry the same payload. Try an alternative mutation or workaround. |
| missingRequiredInputObjectAttribute | A required field is missing from the input | Compare the payload against |
GraphQL始终返回HTTP 200,即使出现错误。请检查数组,而非HTTP状态码。
errors| 代码 | 可能原因 | 恢复措施 |
|---|---|---|
| UNAUTHORIZED | 令牌缺失、过期或遗漏 | 重新获取令牌(选项A)或修复请求头。 |
| PERMISSION_DENIED | 服务账号不是该管道/表格的成员 | 通过 |
| resource_not_found | ID不存在或服务账号无法查看 | 验证ID;检查管道/表格成员身份。 |
| invalid_input | 参数名称或类型错误 | 运行 |
| INTERNAL_SERVER_ERROR | API bug或不支持的负载 | 请勿重试相同负载。尝试替代变更或解决方案。 |
| missingRequiredInputObjectAttribute | 输入中缺少必填字段 | 将负载与 |
Known workarounds
已知解决方案
Cross-pipe create_card
via automation
create_card通过自动化跨管道create_card
create_card- Do NOT use with
createAutomation+action: create_card— returnsfield_map(confirmed API bug).INTERNAL_SERVER_ERROR - Instead, use with the
createCardparameter. Prerequisite: a connector field withthroughConnectorsmust exist.canCreateNewConnected: true
- 请勿使用搭配
createAutomation+action: create_card——会返回field_map(已确认的API bug)。INTERNAL_SERVER_ERROR - 替代方案:使用带有参数的
throughConnectors。前提条件:必须存在一个createCard的连接器字段。canCreateNewConnected: true
Pipe visibility returning empty list
管道可见性返回空列表
- If returns
organization { pipes { ... } }but[], the Service Account is not a member of those pipes.pipesCount > 0 - Pipes created via API are automatically visible to the SA.
- Pipes created in the UI require the SA to be added as an admin.
- Workaround: get pipe IDs from the user once and query directly.
pipe(id: "...")
- 如果返回
organization { pipes { ... } }但[],说明服务账号不是这些管道的成员。pipesCount > 0 - 通过API创建的管道会自动对服务账号可见。
- 在UI中创建的管道需要将服务账号添加为管理员。
- 解决方案:从用户处获取一次管道ID,然后直接查询。
pipe(id: "...")
invite_members
accepts unknown emails silently
invite_membersinvite_members
静默接受无效邮箱
invite_members- Pipefy mints a new for typo addresses without rejecting the invite. Sanity-check email syntax before calling.
user_id
- Pipefy会为拼写错误的地址生成新的,而不会拒绝邀请。调用前请检查邮箱格式是否正确。
user_id
External resources (when raw API also fails)
外部资源(当原生API也失效时)
- Pipefy developer portal:
- API reference:
- Community + changelog:
- Status page: https://status.pipefy.com
Search for the exact error message + "Pipefy GraphQL", or the mutation name + "example Pipefy API".
- Pipefy开发者门户:
- API参考:
- 社区+更新日志:
- 状态页面:https://status.pipefy.com
搜索精确的错误信息 + "Pipefy GraphQL",或变更名称 + "example Pipefy API"。
Escalation to the user (absolute last resort)
上报给用户(绝对最后手段)
Only after all 3 tiers and external resources have failed:
- State exactly what was tried (MCP tool, introspection, raw API).
- Show the verbatim error response.
- Propose a concrete workaround (e.g., "create via the Pipefy UI, then continue via API with the resulting ID").
- Stop — do not loop.
仅在所有3层方案和外部资源都失效后执行:
- 准确说明已尝试的方案(MCP工具、自省、原生API)。
- 展示完整的错误响应内容。
- 提出具体的解决方案(例如:“通过Pipefy UI创建,然后使用生成的ID继续通过API操作”)。
- 停止操作——请勿循环尝试。
Success criteria
成功标准
- The operation completes without an HTTP 4xx/5xx error.
- The response contains a key and
datais null or absent.errors
- 操作完成且无HTTP 4xx/5xx错误。
- 响应包含键,且
data为null或不存在。errors
Failure modes
失败模式
- 401 Unauthorized — token expired or prefix omitted. Re-fetch the OAuth token (Option A).
Bearer - 400 Bad Request — GraphQL syntax error. Validate the query string and escape quotes properly when embedding via shell.
- 500 / service unavailable — Pipefy API outage. Check status.pipefy.com and retry later. Do not loop.
- in
INTERNAL_SERVER_ERRORarray — do NOT retry the same payload; pick a different mutation path.errors
- 401 Unauthorized — 令牌过期或遗漏前缀。重新获取OAuth令牌(选项A)。
Bearer - 400 Bad Request — GraphQL语法错误。验证查询字符串,并在通过shell嵌入时正确转义引号。
- 500 / service unavailable — Pipefy API故障。查看status.pipefy.com并稍后重试。请勿循环尝试。
- 数组中的
errors— 请勿重试相同负载;选择其他变更路径。INTERNAL_SERVER_ERROR
Security notes
安全说明
- Never log or print tokens in plain text.
- Prefer environment variables over inline credentials.
- Use /
PIPEFY_TOKENonly for personal/development use; use service-account credentials (PIPEFY_PAT+PIPEFY_SERVICE_ACCOUNT_CLIENT_ID) for service accounts.PIPEFY_SERVICE_ACCOUNT_CLIENT_SECRET
- 请勿以明文形式记录或打印令牌。
- 优先使用环境变量而非内联凭证。
- /
PIPEFY_TOKEN仅用于个人/开发用途;服务账号请使用服务账号凭证(PIPEFY_PAT+PIPEFY_SERVICE_ACCOUNT_CLIENT_ID)。PIPEFY_SERVICE_ACCOUNT_CLIENT_SECRET
See also
另请参阅
- skills/introspection/pipefy-introspection/SKILL.md — Tier 2: use and introspection tools through the MCP server before falling back to direct HTTP.
execute_graphql
- skills/introspection/pipefy-introspection/SKILL.md — 第2层:在回退到直接HTTP请求前,通过MCP服务器使用和自省工具。
execute_graphql