pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

[Components] emboss - new app actions

Open edwinorange opened this issue 5 months ago • 5 comments

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

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

New app

  • [x] The app updated in this PR is already integrated (#21116 — app scaffolding landed in 321852dac)

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.

edwinorange avatar Jun 12 '26 16:06 edwinorange

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 Jul 6, 2026 6:30pm

Request Review

vercel[bot] avatar Jun 12 '26 16:06 vercel[bot]

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

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:

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

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • PipedreamHQ/pipedream#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[bot] avatar Jun 12 '26 16:06 coderabbitai[bot]

Addressed the outside-diff comment in e262f7587 — 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.

edwinorange avatar Jun 12 '26 18:06 edwinorange

@edwinorange Can you kindly resolve the conflicts

vetrivigneshwaran avatar Jul 06 '26 18:07 vetrivigneshwaran

@vetrivigneshwaran Done — merged master into the branch and resolved the conflicts (they came from the auto-generated emboss scaffolding in emboss.app.mjs and its empty lockfile entry; kept the full implementation from this PR). The PR shows as mergeable again.

edwinorange avatar Jul 06 '26 18:07 edwinorange