Skip to content

[Components] emboss - new app actions#21152

Open
edwinorange wants to merge 12 commits into
PipedreamHQ:masterfrom
edwinorange:emboss-components
Open

[Components] emboss - new app actions#21152
edwinorange wants to merge 12 commits into
PipedreamHQ:masterfrom
edwinorange:emboss-components

Conversation

@edwinorange

@edwinorange edwinorange commented Jun 12, 2026

Copy link
Copy Markdown

Summary

New app components for Emboss (https://pipedream.com/apps/emboss) — requested and integrated in #21116 (thanks @sergio-eliot-rodriguez!).

Emboss turns flat PDFs into fillable forms and fills them with AI. This PR adds the app file and three actions:

  • Create Fillable Form (emboss-create-fillable-form) — flat PDF in, fillable PDF + form ID out
  • Fill PDF From Context (emboss-fill-from-pdf-context) — flat PDF + context (text and/or a file) in; Emboss detects the fields, fills them, and returns the completed PDF
  • Fill Existing Form (emboss-fill-existing-form) — fill a previously created form (async-options dropdown backed by the account's forms) from context

Implementation notes:

  • Form processing is asynchronous server-side; the actions poll with $.flow.rerun (5s cadence, ~12-minute budget) and throw a clear error at exhaustion rather than letting the workflow proceed silently.
  • File input via format: "file-ref" string props + syncDir (read-write, sync), read with getFileStreamAndMetadata; output written to /tmp and returned as filepath.
  • Multipart uploads via form-data with knownLength + maxBodyLength: Infinity (convertapi precedent).
  • ConfigurationError guards for missing file and for fills with no context at all (prevents a billable no-op).
  • All actions carry annotations; eslint components/emboss is clean.

Testing

All three actions were tested end-to-end against the production Emboss API from a Pipedream workspace (dev-published versions of this exact code):

  • Create Fillable Form: public PDF URL in → form_id, status: ready, filepath out.
  • Fill PDF From Context: tested in a deployed workflow (webhook trigger → action): 10-page city film-permit packet + a long narrative; executed in ~145s through the rerun poll cycle and returned session_id, fill report, and the completed PDF's filepath.
  • Fill Existing Form: the Form dropdown populated from the connected account's forms (async options verified); fill of an existing form returned session_id + filepath.
  • Connected-account auth ($auth.api_key) verified live.

Checklist

Versioning

  • All components updated in this PR had their version updated (0.0.1 for new ones)
  • The app updated in this PR had its package.json's version updated (0.0.1 scaffold → 0.1.0)

New app

CodeRabbit review

  • I have addressed or acknowledged all of CodeRabbit's review comments

Summary by CodeRabbit

  • New Features
    • Actions to create fillable forms, fill existing forms, and fill PDFs from document context with asynchronous job polling.
  • Improvements
    • Expanded Emboss API client with form selection and comprehensive API methods; added shared utilities for file handling and error normalization.
  • Documentation
    • Added Emboss getting-started guide covering setup, polling behavior, timeouts, and troubleshooting.
  • Chores
    • Emboss package version bumped.

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Jun 15, 2026 12:06pm

Request Review

@pipedream-component-development

Copy link
Copy Markdown
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development

Copy link
Copy Markdown
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a full Emboss integration: an API client, shared utilities, three Pipedream actions (create-fillable-form, fill-from-pdf-context, fill-existing-form) with polling and PDF output, package dependency updates, and README documentation.

Changes

Emboss Component Integration

Layer / File(s) Summary
Emboss API client and methods
components/emboss/emboss.app.mjs
Builds authentication headers, base URL resolution, and _makeRequest wrapper; adds form listing/creation, fillable PDF download, context job creation/polling, and session fill/download methods.
Shared utility helpers
components/emboss/common/utils.mjs
Exports resolveFileRef for file metadata, contextParts for multipart assembly, writePdf for disk output, and errorDetail for error normalization across actions.
Create Fillable Form action
components/emboss/actions/create-fillable-form/create-fillable-form.mjs
Uploads a PDF via createForm, polls job status with bounded retries and reruns, handles timeout/failure states, downloads the fillable result via getFillablePdf, and writes output to /tmp.
Fill Existing Form action
components/emboss/actions/fill-existing-form/fill-existing-form.mjs
Accepts a form ID and context text/file, submits context via fillExistingForm, polls context job status on reruns, then calls fillSession and getSessionPdf to generate the filled PDF output.
Fill from PDF Context action
components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs
Validates and resolves file/context inputs, submits combined payload via createWithContext, polls context job status with retry bounds, then fills session and exports result PDF; supports both inline and file-based context.
Documentation and dependencies
components/emboss/package.json, components/emboss/README.md
Bumps version to 0.1.0 and adds form-data and @pipedream/platform dependencies; README documents component overview, setup steps, use cases, and troubleshooting for long-running polling and workflow timeouts.

Sequence Diagram

sequenceDiagram
  participant Action as Pipedream Action
  participant App as Emboss App
  participant Flow as $.flow
  participant FS as writePdf
  Action->>App: createForm / createWithContext / fillExistingForm (multipart)
  App-->>Action: job_id / form_id
  Action->>Flow: rerun(delay, job_id/form_id)
  loop Polling (bounded)
    Action->>App: getForm / getContextJob
    App-->>Action: status
    alt ready
      Action->>App: fillSession
      App-->>Action: session_id
      Action->>App: getSessionPdf / getFillablePdf
      App-->>Action: pdf_bytes
      Action->>FS: writePdf(pdf_bytes)
    else not ready
      Action->>Flow: rerun(delay, job_id/form_id)
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • [APP] Emboss #21116: Implements the Emboss app and the three action endpoints (create-fillable-form, fill-existing-form, fill-from-pdf-context) with polling and error handling as requested.

Suggested reviewers

  • michelle0927
  • mariano-pd
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title '[Components] emboss - new app actions' accurately summarizes the main change: adding a new Emboss app with three new actions to the components library.
Description check ✅ Passed The PR description is comprehensive and follows the template structure. It includes a detailed summary of changes, implementation notes, testing verification, and a completed checklist with all required versioning and app integration items confirmed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/emboss/actions/fill-existing-form/fill-existing-form.mjs`:
- Around line 30-41: Update the prop descriptions for contextText and
contextFile to include concrete inline examples so AI agents can infer expected
formats: modify the description for contextText (symbol: contextText) to append
an example like "e.g., 'Customer name: John Doe, Order ID: 12345, Amount:
$99.99'" and update contextFile (symbol: contextFile) description to include
file-ref examples such as 'e.g., "/tmp/customer_data.pdf" or
"https://example.com/invoice.pdf" while keeping format: "file-ref" intact;
ensure the wording remains concise and optional: true unchanged.
- Line 14: Update the component's "description" string in fill-existing-form.mjs
to the expanded, agent-friendly version: state primary purpose, when to use,
cross-tool prerequisite (Create Fillable Form), required parameters (at least
one context input: text or file), behavior/gotcha (polls until fill job
completes with ~12 minute timeout), and keep the documentation link; replace the
current short description with the suggested full sentence so AI agents get
purpose, usage, parameter notes, and polling caveat.

In `@components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs`:
- Around line 11-21: The action's description string (in the exported object
with key "emboss-fill-from-pdf-context" and name "Fill PDF From Context") is too
minimal for AI agents; replace the current description value with an expanded,
agent-friendly sentence that follows the pattern: primary purpose → when to use
(include job poll time ~12 minutes) → cross-tool alternatives (mention "Fill
Existing Form" and "Create Fillable Form") → any parameter notes (accepts flat
PDF + context text/file) → gotchas → docs link (https://getemboss.ai/docs).
Ensure the new text remains a single string assigned to the description property
of the default export.
- Around line 30-35: The description for the contextText property lacks an
inline example; update the contextText descriptor (property name: contextText)
by appending a short concrete example to its description string showing the
expected input format (e.g., a one- or two-sentence excerpt or bulleted lines
such as "Client: Acme Corp; Invoice: 12345; Notes: deliver by 6/1") so consumers
know how to structure the text; modify the description field inside the
fill-from-pdf-context module where contextText is defined to include that
example.

In `@components/emboss/common/utils.mjs`:
- Around line 52-58: The writePdf function concatenates name into /tmp without
validation; sanitize the name parameter in writePdf to prevent path traversal by
rejecting or normalizing inputs that contain directory separators or absolute
paths (e.g., strip path separators, use the basename-equivalent, or validate
against a safe filename regex), ensure the resulting filepath is strictly within
/tmp, and then write the buffer to that sanitized filepath before returning {
filepath }.

In `@components/emboss/README.md`:
- Around line 38-40: Update the "Step times out while polling" recommendation in
the README: change the suggested workflow execution timeout from "300 seconds"
to at least "720–750 seconds" (or state "at least 12–13 minutes") so polling can
complete; edit the text under the "Step times out while polling" paragraph in
components/emboss/README.md to reflect the new timeout guidance.
- Around line 35-37: Update the README text to match the actual polling budget
used by the Emboss actions: replace the "up to 5 minutes" wording with the real
duration computed from MAX_RETRIES = 144 and POLL_DELAY_MS = 5000 (approximately
12 minutes / 720 seconds); reference the constants MAX_RETRIES and POLL_DELAY_MS
and note that all three Emboss actions use them so the README and the actions'
error messages remain consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c7cd75f7-f91f-4aef-9eed-5257244150eb

📥 Commits

Reviewing files that changed from the base of the PR and between 8165bb3 and 548d062.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • components/emboss/README.md
  • components/emboss/actions/create-fillable-form/create-fillable-form.mjs
  • components/emboss/actions/fill-existing-form/fill-existing-form.mjs
  • components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs
  • components/emboss/common/utils.mjs
  • components/emboss/emboss.app.mjs
  • components/emboss/package.json

Comment thread components/emboss/actions/fill-existing-form/fill-existing-form.mjs Outdated
Comment thread components/emboss/actions/fill-existing-form/fill-existing-form.mjs
Comment thread components/emboss/common/utils.mjs
Comment thread components/emboss/README.md
Comment thread components/emboss/README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/emboss/actions/create-fillable-form/create-fillable-form.mjs (1)

57-60: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Shared root cause: polling success branches omit $summary in all three Emboss actions.

create-fillable-form, fill-existing-form, and fill-from-pdf-context each have successful rerun branches that return without calling $.export("$summary", ...). Add one concise summary call in every successful return branch for each file.

As per coding guidelines, run() must call $.export("$summary", ...) on every successful execution path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/emboss/actions/create-fillable-form/create-fillable-form.mjs`
around lines 57 - 60, Polling success branches that call $.flow.rerun(...) and
then return (e.g., the branch using $.flow.rerun(POLL_DELAY_MS, { form_id:
created.form_id }, MAX_RETRIES)) are missing the required summary export; add a
concise $.export("$summary", "...") call immediately before each return in all
three actions (create-fillable-form, fill-existing-form, fill-from-pdf-context)
so every successful execution path calls $.export("$summary", ...) — include a
short, clear message (e.g., "Polling scheduled for form {form_id}" or final
success text when appropriate) referencing the form_id where available.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@components/emboss/actions/create-fillable-form/create-fillable-form.mjs`:
- Around line 57-60: Polling success branches that call $.flow.rerun(...) and
then return (e.g., the branch using $.flow.rerun(POLL_DELAY_MS, { form_id:
created.form_id }, MAX_RETRIES)) are missing the required summary export; add a
concise $.export("$summary", "...") call immediately before each return in all
three actions (create-fillable-form, fill-existing-form, fill-from-pdf-context)
so every successful execution path calls $.export("$summary", ...) — include a
short, clear message (e.g., "Polling scheduled for form {form_id}" or final
success text when appropriate) referencing the form_id where available.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e352763f-a31a-4110-84ad-73be4996c09c

📥 Commits

Reviewing files that changed from the base of the PR and between 548d062 and d4c03d0.

📒 Files selected for processing (5)
  • components/emboss/README.md
  • components/emboss/actions/create-fillable-form/create-fillable-form.mjs
  • components/emboss/actions/fill-existing-form/fill-existing-form.mjs
  • components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs
  • components/emboss/common/utils.mjs

@edwinorange

Copy link
Copy Markdown
Author

Addressed the outside-diff comment in e262f75 — all six polling branches (initial submit + re-poll, across the three actions) now export an interim $summary before returning, so every successful execution path exports one; the final ready-branch export overwrites it on completion. Nice side effect: the paused step now shows live progress text while polling.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs (1)

24-47: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Centralize these reused props in emboss.app.mjs propDefinitions.

file, contextText, contextFile, and syncDir are defined inline here even though equivalent definitions are reused across Emboss actions. Move shared definitions to app-level propDefinitions and reference them via propDefinition to avoid drift.

As per coding guidelines, props used in more than one component must be defined in the app file propDefinitions and referenced via propDefinition.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs`
around lines 24 - 47, The props file, contextText, contextFile and syncDir are
duplicated here and should be centralized in the app-level propDefinitions to
prevent drift; update emboss.app.mjs to add canonical definitions for these
props (names: file, contextText, contextFile, syncDir) under propDefinitions,
then in fill-from-pdf-context.mjs remove the inline prop blocks and replace them
with propDefinition references (propDefinition: "file", etc.) so the action uses
the shared definitions; ensure formats/accessMode/sync and optional flags match
the original definitions when moving them.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs`:
- Around line 24-47: The props file, contextText, contextFile and syncDir are
duplicated here and should be centralized in the app-level propDefinitions to
prevent drift; update emboss.app.mjs to add canonical definitions for these
props (names: file, contextText, contextFile, syncDir) under propDefinitions,
then in fill-from-pdf-context.mjs remove the inline prop blocks and replace them
with propDefinition references (propDefinition: "file", etc.) so the action uses
the shared definitions; ensure formats/accessMode/sync and optional flags match
the original definitions when moving them.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8d281113-c419-46dd-8ba1-4b5f6259c2bf

📥 Commits

Reviewing files that changed from the base of the PR and between d4c03d0 and e262f75.

📒 Files selected for processing (3)
  • components/emboss/actions/create-fillable-form/create-fillable-form.mjs
  • components/emboss/actions/fill-existing-form/fill-existing-form.mjs
  • components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs

@ashwins01 ashwins01 linked an issue Jun 15, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User submitted Submitted by a user

Projects

Status: Ready for PR Review

Development

Successfully merging this pull request may close these issues.

[APP] Emboss

5 participants