Loading...
Loading...
Use this skill when an MCP tool fails AND the introspection skill could not resolve the problem. This is the last-resort fallback (Tier 3): call the Pipefy GraphQL API directly using curl or httpx, authenticating with the Service Account (OAuth2) or a Personal Access Token (PAT) available as env var. Follow the 3-tier resolution strategy before reaching this point.
npx skill4agent add pipefy/ai-toolkit pipefy-api-fallback| 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 |
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'])")TOKEN="$PIPEFY_PAT" # or $PIPEFY_TOKENBearer PIPEFY_SERVICE_ACCOUNT_CLIENT_IDPIPEFY_SERVICE_ACCOUNT_CLIENT_SECRETPIPEFY_PATPIPEFY_TOKEN| Purpose | URL |
|---|---|
| All queries and mutations | |
| Schema introspection only | |
| OAuth2 token | |
api.pipefy.comapp.pipefy.comPIPEFY_BASE_URLcurl -s -X POST https://api.pipefy.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ me { id name } }"}' | jq .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 .| 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 | |
app.pipefy.com/graphql# All 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 } } } }"}'
# 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 } } } } }"}'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 |
create_cardcreateAutomationaction: create_cardfield_mapINTERNAL_SERVER_ERRORcreateCardthroughConnectorscanCreateNewConnected: trueorganization { pipes { ... } }[]pipesCount > 0pipe(id: "...")invite_membersuser_iddataerrorsBearer INTERNAL_SERVER_ERRORerrorsPIPEFY_TOKENPIPEFY_PATPIPEFY_SERVICE_ACCOUNT_CLIENT_IDPIPEFY_SERVICE_ACCOUNT_CLIENT_SECRETexecute_graphql