pipefy-attachments

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Attachments

附件

Upload one file at a time to a card or table-record attachment field. The upload goes through Pipefy's presigned URL flow (request URL, S3 PUT, then field update). 3 MCP tools, 2 CLI commands.

每次将一个文件上传至卡片或表格记录的附件字段。上传流程遵循Pipefy的预签名URL机制(请求URL、S3 PUT、然后更新字段)。3种MCP工具,2条CLI命令。

When to use

使用场景

  • The user says "attach this file to card X" or "upload to the documents field on record Y".
  • Pick the source by where the bytes actually are (see Trust model):
    • The file is on a disk the MCP server can read →
      file_path
      .
    • The file is reachable at an HTTPS URL →
      file_url
      .
    • The server can't read the file (a local file on the hosted profile), or it's larger than the 100 MiB in-tool cap → the presigned handshake (
      create_attachment_presigned_url
      ; see "Uploading a file the server can't read" below), where the client does the upload.
    • The agent generated bytes in a sandbox the server cannot read → write them to a path the server can read and use
      file_path
      , or host them at a URL and use
      file_url
      .
Do not use this skill for:
  • Reading or listing existing attachments. There is no list/download tool in this skill scope. Cards and table records expose their attachments through the regular card/record fetch tools.
  • Bulk uploads. One file per call; iterate at the agent layer.
  • 用户说“将此文件附加到卡片X”或“上传到记录Y的文档字段”。
  • 根据文件实际存储位置选择来源(请参考信任模型):
    • 文件位于MCP服务器可读取的磁盘上 → 使用
      file_path
    • 文件可通过HTTPS URL访问 → 使用
      file_url
    • 服务器无法读取该文件(托管环境中的本地文件),或文件大小超过工具内置的100 MiB限制 → 使用预签名URL交互(
      create_attachment_presigned_url
      ;详见下文“上传服务器无法读取的文件”),由客户端完成上传。
    • 代理在服务器无法读取的沙箱中生成了字节数据 → 将其写入服务器可读取的路径并使用
      file_path
      ,或托管至某个URL并使用
      file_url
不要使用本技能的场景:
  • 读取或列出现有附件。本技能范围内没有列出/下载工具。卡片和表格记录会通过常规的卡片/记录获取工具暴露其附件。
  • 批量上传。每次调用仅上传一个文件;如需批量操作,请在代理层进行迭代。

Prerequisites

前提条件

  • A Pipefy
    organization_id
    . Find it via
    get_organization
    or
    get_pipe
    .
  • A target
    card_id
    or
    table_record_id
    .
  • The attachment field's slug (the human-readable id like
    document_upload
    , not the field's uuid). Find it on the card or table record fetch tools.
  • Exactly one file source: a
    file_path
    the MCP server can read, or a
    file_url
    the server can download.
  • Pipefy
    organization_id
    。可通过
    get_organization
    get_pipe
    获取。
  • 目标
    card_id
    table_record_id
  • 附件字段的slug(类似
    document_upload
    的人类可读ID,而非字段的UUID)。可通过卡片或表格记录获取工具查找。
  • 恰好一个文件来源:MCP服务器可读取的
    file_path
    ,或服务器可下载的
    file_url

Tools needed

所需工具

Tool (MCP)CLI equivalentRead-only
upload_attachment_to_card
pipefy attachment upload --card <id>
No
upload_attachment_to_table_record
pipefy attachment upload --record <id>
No
create_attachment_presigned_url
pipefy attachment presign
No
工具(MCP)CLI 等效命令是否只读
upload_attachment_to_card
pipefy attachment upload --card <id>
upload_attachment_to_table_record
pipefy attachment upload --record <id>
create_attachment_presigned_url
pipefy attachment presign

Trust model

信任模型

The upload tools accept exactly one source. Which one depends on where the MCP server runs relative to the bytes:
  • file_path
    is a path on the machine running the MCP server. In the local distribution the server is a subprocess of the agent runtime with the same filesystem access as the user, so any path the user can read works.
    file_path
    is local profile only: on the hosted server (a shared HTTP service) it has no meaning and is rejected — the file is not on the server's disk.
  • file_url
    is an HTTPS URL the server downloads (http only if the deployment enables insecure URLs). It works on any profile and is the hosted-safe source. The download runs behind an SSRF guard (HTTPS and public hosts only unless the deployment opts into insecure URLs) and the same 100 MiB cap as
    file_path
    .
A common trap: an agent running against the hosted server (or a local server whose client generated the file in a separate sandbox) has no shared disk with the server, so a temp
file_path
the agent writes is unreadable by the server. Use
file_url
when the bytes are reachable at a URL; otherwise place the file where the server can read it and use
file_path
.
The CLI always runs locally as the user, so it exposes
--file
(a local path) only.
上传工具仅接受一种来源。具体选择哪种取决于MCP服务器与文件数据的相对位置:
  • file_path
    是运行MCP服务器的机器上的路径。在本地分发版本中,服务器是代理运行时的子进程,拥有与用户相同的文件系统访问权限,因此用户可读取的任何路径均有效。
    file_path
    仅适用于本地环境:在托管服务器(共享HTTP服务)上无实际意义且会被拒绝——文件不在服务器磁盘上。
  • file_url
    是服务器可下载的HTTPS URL(若部署启用了不安全URL,则也支持HTTP)。它适用于任何环境,是托管环境下的安全来源。下载操作受SSRF防护(仅允许HTTPS和公共主机,除非部署选择启用不安全URL),且与
    file_path
    一样有100 MiB的大小限制。
常见误区:运行在托管服务器上的代理(或其客户端在独立沙箱中生成文件的本地服务器)与服务器无共享磁盘,因此代理写入的临时
file_path
无法被服务器读取。若文件可通过URL访问,请使用
file_url
;否则请将文件放置在服务器可读取的位置并使用
file_path
CLI始终以用户身份在本地运行,因此仅暴露
--file
(本地路径)参数。

Steps

操作步骤

Upload a local file to a card

将本地文件上传至卡片

file_name
is inferred from the source basename when omitted, so callers usually only pass the four IDs and the source.
MCP:
upload_attachment_to_card organization_id=42 card_id=1234 field_id=document_upload file_path=~/report.pdf
CLI:
bash
pipefy attachment upload --org 42 --card 1234 --field document_upload --file ~/report.pdf
若省略
file_name
,则会从源文件的基名自动推断,因此调用方通常只需传入四个ID和来源。
MCP命令:
upload_attachment_to_card organization_id=42 card_id=1234 field_id=document_upload file_path=~/report.pdf
CLI命令:
bash
pipefy attachment upload --org 42 --card 1234 --field document_upload --file ~/report.pdf

Upload from a URL (hosted-safe)

从URL上传(托管环境安全)

upload_attachment_to_card organization_id=42 card_id=1234 field_id=document_upload file_url=https://example.com/report.pdf
When the URL has no filename in its path (e.g.
.../download?id=1
), pass
file_name
explicitly so Pipefy stores it under a real name.
upload_attachment_to_card organization_id=42 card_id=1234 field_id=document_upload file_url=https://example.com/report.pdf
若URL路径中无文件名(例如
.../download?id=1
),请显式传入
file_name
,以便Pipefy使用真实名称存储文件。

Upload a local file to a table record

将本地文件上传至表格记录

MCP:
upload_attachment_to_table_record organization_id=42 table_record_id=tr-555 field_id=document_upload file_path=/tmp/export.csv
CLI:
bash
pipefy attachment upload --org 42 --record tr-555 --field document_upload --file /tmp/export.csv
MCP命令:
upload_attachment_to_table_record organization_id=42 table_record_id=tr-555 field_id=document_upload file_path=/tmp/export.csv
CLI命令:
bash
pipefy attachment upload --org 42 --record tr-555 --field document_upload --file /tmp/export.csv

Overriding the file name

自定义文件名

To store the attachment under a different name than the source basename, pass
file_name
explicitly. It wins over the inferred basename.
upload_attachment_to_card ... file_url=https://example.com/abc123.pdf file_name=Invoice-2026.pdf
若要以不同于源文件基名的名称存储附件,请显式传入
file_name
。该参数优先级高于自动推断的基名。
upload_attachment_to_card ... file_url=https://example.com/abc123.pdf file_name=Invoice-2026.pdf

Uploading a file the server can't read: the presigned handshake

上传服务器无法读取的文件:预签名URL交互

file_path
and
file_url
both need the server to reach the bytes — a disk it can read, or a URL it can fetch. When neither holds (a local file on the hosted server, or bytes larger than the 100 MiB in-tool cap), use
create_attachment_presigned_url
so the client does the upload while the server only mints the target:
  1. Call
    create_attachment_presigned_url
    with
    organization_id
    +
    file_name
    (optional
    content_type
    /
    content_length
    ). It returns
    upload_url
    (the S3 PUT url),
    storage_path
    (the object key), and
    expires_in_seconds
    .
  2. From an environment that can reach the upload host, HTTP
    PUT
    the file bytes to
    upload_url
    within
    expires_in_seconds
    (send
    Content-Type
    /
    Content-Length
    matching what you passed, if any).
  3. Set the attachment field to
    [storage_path]
    via
    update_card_field
    /
    set_table_record_field_value
    . Store
    storage_path
    , never a URL — the signed download URL is minted on read.
Because the bytes are handled by the client (step 2), not passed through the tool call, this keeps the model's context clean.
Which clients can do step 2:
  • Code-execution clients (Claude Code, Claude Desktop): read the file and
    PUT
    it from your own code — the bytes never enter the conversation.
  • Subagent tip: if your client can spawn subagents, run steps 1–2 inside one so even transient handling stays out of the main conversation's context.
  • claude.ai caveat: the claude.ai code-execution sandbox cannot reach the S3 upload host by default (network egress allow-list). An org owner must allow-list the upload host for the
    PUT
    to succeed there; until then, this path is blocked on claude.ai and a
    file_url
    the server can fetch is the alternative.
The CLI equivalent is
pipefy attachment presign
(prints
upload_url
/
storage_path
/
expires_in_seconds
); you run the
PUT
and the field update.
file_path
file_url
都要求服务器能够访问文件数据——无论是可读取的磁盘还是可获取的URL。当两者都不满足时(托管服务器上的本地文件,或文件大小超过工具内置的100 MiB限制),请使用
create_attachment_presigned_url
,让客户端完成上传,而服务器仅生成目标地址:
  1. 使用
    organization_id
    +
    file_name
    (可选
    content_type
    /
    content_length
    )调用
    create_attachment_presigned_url
    。返回结果包含
    upload_url
    (S3 PUT地址)、
    storage_path
    (对象键)和
    expires_in_seconds
    (有效期秒数)。
  2. 在能够访问上传主机的环境中,在
    expires_in_seconds
    有效期内,通过HTTP
    PUT
    将文件数据上传至
    upload_url
    (若传入了
    Content-Type
    /
    Content-Length
    ,请确保请求头与之匹配)。
  3. 通过
    update_card_field
    /
    set_table_record_field_value
    将附件字段设置为
    [storage_path]
    。请保存
    storage_path
    ,而非URL——签名下载URL会在读取时生成。
由于文件数据由客户端处理(步骤2),不会通过工具调用传递,因此可保持模型上下文整洁。
哪些客户端可执行步骤2:
  • 代码执行客户端(Claude Code、Claude Desktop):读取文件并通过自有代码执行
    PUT
    操作——文件数据不会进入对话内容。
  • 子代理提示:若客户端可生成子代理,请在子代理内执行步骤1–2,以便临时处理过程也不会进入主对话的上下文。
  • claude.ai注意事项:claude.ai的代码执行沙箱默认无法访问S3上传主机(网络出口有允许列表)。组织所有者必须将上传主机加入允许列表,
    PUT
    操作才能成功;在此之前,该路径在claude.ai上是被阻止的,替代方案是使用服务器可获取的
    file_url
对应的CLI命令是
pipefy attachment presign
(输出
upload_url
/
storage_path
/
expires_in_seconds
);您需要自行执行
PUT
操作和字段更新。

Success criteria

成功判定标准

upload_attachment_to_card
/
upload_attachment_to_table_record
(one-shot): the payload has
success: true
, a
download_url
(the signed URL Pipefy returns), the inferred or explicit
content_type
, and the
file_size
in bytes, and the attachment field on the card or record now lists the file. One call is the whole job.
create_attachment_presigned_url
(handshake) is not done at mint:
success: true
here only means a target was minted — no field was touched and nothing is attached yet. Done means you completed all three steps: after the client PUTs the bytes to
upload_url
and you set the field to
[storage_path]
, the attachment field lists the file. Do not treat the mint response (or its premature signed URL) as a finished upload.
upload_attachment_to_card
/
upload_attachment_to_table_record
(单次调用):返回负载包含
success: true
download_url
(Pipefy返回的签名URL)、自动推断或显式指定的
content_type
,以及以字节为单位的
file_size
,且卡片或记录的附件字段现在已列出该文件。一次调用即可完成整个任务。
create_attachment_presigned_url
(交互流程)在生成地址时并未完成上传:此处的
success: true
仅表示已生成目标地址——尚未修改任何字段,也未附加任何内容。完成上传意味着您已完成所有三个步骤:客户端将数据
PUT
upload_url
,且您已将字段设置为
[storage_path]
,此时附件字段会列出该文件。请勿将生成地址的响应(或其提前生成的签名URL)视为已完成上传。

Failure modes

失败场景

The one-shot tools carry a
step
field on failure. The handshake tool can fail at mint (
step=validation
/
presigned_url
, below), but its client PUT and field update happen outside the tool — a non-2xx PUT or a failed
update_card_field
/
set_table_record_field_value
surfaces there, not as a
step
on the mint response. The
step
values:
  • step=validation
    .
    No source, both sources, a
    file_url
    with no inferable
    file_name
    , or
    file_path
    passed on the hosted server. Recovery: pass exactly one source; on the hosted server use
    file_url
    ; supply
    file_name
    when a URL has no basename.
  • step=file_read
    .
    file_path
    does not exist, points to a directory, is unreadable, has an unknown
    ~user
    prefix, or is larger than 100 MiB. The path is read on the machine running the server (which may not be the agent's own environment). Recovery: verify the path exists as a regular file the server's user can read and is under the cap, or switch to
    file_url
    .
  • step=download
    .
    The
    file_url
    failed its SSRF guard (non-HTTPS, private/internal host), exceeded 100 MiB, timed out, returned an HTTP error, or redirected too many times. Recovery: confirm the URL is a public HTTPS address serving the file directly and under the cap.
  • step=presigned_url
    .
    Organization id rejected, field id not an attachment, or Pipefy refused the request. Recovery: confirm
    organization_id
    with
    get_organization
    and that the field is actually an attachment field on the target card or record.
  • step=s3_upload
    .
    The presigned URL expired before PUT, or content/headers did not match what was signed. Recovery: retry the tool to obtain a fresh presigned URL.
  • step=field_update
    .
    The field rejected the new attachment list (wrong type, missing permission). Recovery: confirm the field accepts attachments and that the caller has write access to the card or record.
If an argument has the wrong type (a coercion failure before the body runs), the payload uses the standard Pipefy invalid-arguments envelope instead:
{"success": false, "error": {"code": "INVALID_ARGUMENTS", "message": "...", "details": {"errors": [...]}}}
. Recovery: read
error.details.errors[*].path
to see which argument failed, then retry.
单次调用工具失败时会包含
step
字段。交互流程工具可能在生成地址阶段失败(
step=validation
/
presigned_url
,如下所示),但其客户端PUT操作和字段更新发生在工具外部——PUT返回非2xx状态码或
update_card_field
/
set_table_record_field_value
失败时,会在对应操作中体现,而非在生成地址的响应中以
step
形式返回。
step
取值说明:
  • step=validation
    :未指定来源、同时指定两种来源、
    file_url
    无法推断
    file_name
    ,或在托管服务器上传递了
    file_path
    。解决方法:仅指定一种来源;在托管服务器上使用
    file_url
    ;当URL无基名时提供
    file_name
  • step=file_read
    file_path
    不存在、指向目录、不可读、包含未知的
    ~user
    前缀,或大小超过100 MiB。路径是在运行服务器的机器上读取的(可能并非代理自身的环境)。解决方法:验证路径是否为服务器用户可读取的常规文件且大小未超过限制,或切换至
    file_url
  • step=download
    file_url
    未通过SSRF防护(非HTTPS、私有/内部主机)、大小超过100 MiB、超时、返回HTTP错误,或重定向次数过多。解决方法:确认URL是可直接提供文件的公共HTTPS地址且大小未超过限制。
  • step=presigned_url
    :组织ID被拒绝、字段ID并非附件字段,或Pipefy拒绝了请求。解决方法:通过
    get_organization
    确认
    organization_id
    ,并确认目标卡片或记录上的字段确实是附件字段。
  • step=s3_upload
    :预签名URL在PUT前已过期,或内容/请求头与签名时不匹配。解决方法:重新调用工具获取新的预签名URL。
  • step=field_update
    :字段拒绝新的附件列表(类型错误、权限不足)。解决方法:确认字段接受附件,且调用方对卡片或记录有写入权限。
若参数类型错误(在请求体执行前发生强制转换失败),负载会使用标准Pipefy无效参数格式:
{"success": false, "error": {"code": "INVALID_ARGUMENTS", "message": "...", "details": {"errors": [...]}}}
。解决方法:查看
error.details.errors[*].path
确定哪个参数失败,然后重试。

See also

另请参阅

  • skills/pipes-and-cards/pipefy-pipes-and-cards/SKILL.md
    : finding card ids and attachment field slugs.
  • skills/database-tables/pipefy-database-tables/SKILL.md
    : finding table record ids and field slugs.
  • skills/pipes-and-cards/pipefy-pipes-and-cards/SKILL.md
    :查找卡片ID和附件字段slug。
  • skills/database-tables/pipefy-database-tables/SKILL.md
    :查找表格记录ID和字段slug。