Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ee977d0
Create the "List Templates" action.
docugenerate Aug 22, 2025
d222ea5
Update "List Templates" action with the correct URL.
docugenerate Aug 22, 2025
82ea93f
Update for the "templateId" prop.
docugenerate Aug 22, 2025
13365fe
Add success message with $.export("$summary")
docugenerate Aug 22, 2025
edf128f
Add the "Delete Template" action.
docugenerate Aug 22, 2025
33b92b7
Create the "List Documents" action.
docugenerate Aug 22, 2025
7dd2c3a
Add the "Get Document" action.
docugenerate Aug 22, 2025
f64d548
Update the "Get Document" action.
docugenerate Aug 24, 2025
9e7c4a2
Add the "Update Document" action.
docugenerate Aug 24, 2025
8f23625
Add the "Delete Document" action.
docugenerate Aug 24, 2025
d3b9341
Add "Generate Document" action.
docugenerate Aug 24, 2025
99471ff
Add "Generate Document" action.
docugenerate Aug 24, 2025
b3f30aa
Add optional fields.
docugenerate Aug 24, 2025
e338990
Update output format options.
docugenerate Aug 24, 2025
cb1c952
Update summary message.
docugenerate Aug 24, 2025
128e97c
Set version: "1.0.0" for all actions.
docugenerate Aug 24, 2025
d0d6347
Update package.json
docugenerate Aug 24, 2025
a95e98f
Update README file.
docugenerate Aug 24, 2025
7957346
Merge branch 'master' into docugenerate
docugenerate Aug 24, 2025
86b0a53
Fix step numbering in README.
docugenerate Aug 25, 2025
70fa53a
Merge branch 'master' into docugenerate
GTFalcao Sep 29, 2025
eb7bdcb
Running eslint --fix
GTFalcao Sep 29, 2025
67aacce
Moving actions to individual folders
GTFalcao Sep 29, 2025
5bd9e80
Adding docs links to descriptions
GTFalcao Sep 29, 2025
d21218f
Fixing package version
GTFalcao Sep 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions components/docugenerate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,25 @@ The DocuGenerate API lets you automate document creation and management tasks wi
- **Automated Report Creation and Distribution**: Schedule a workflow to run weekly, gathering data from tools such as Google Sheets or a database. Use this data to create a tailored report via DocuGenerate and subsequently email the report to a list of stakeholders using an email service like SendGrid.

- **Dynamic Invoice Creation from E-Commerce Platforms**: When a new order is placed on an e-commerce platform (like Shopify), trigger a Pipedream workflow that creates an invoice through the DocuGenerate API. Then, archive the invoice in cloud storage like Google Drive and update the order status within the e-commerce platform.

# Getting Started

## Obtaining Your API Key

1. Sign up for a [DocuGenerate](https://www.docugenerate.com/) account
2. Get your unique API Key from the Developers tab in the [Settings](https://app.docugenerate.com/settings/developers) page
3. Copy the API Key for use in Pipedream

## Connecting to Pipedream

1. In your Pipedream workflow, add a DocuGenerate action
2. When prompted for authentication, paste your API Key
3. Test the connection by using the "List Templates" action

## Generating Your First Document

Use the "Generate Document" action with:
- **Template**: Select from your available templates
- **Data**: Provide JSON data matching your template merge tags (e.g., `{ "name": "John Doe" }`)
- **Name**: Set a custom document name (optional)
- **Format**: Choose your desired output format (optional)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-delete-document",
name: "Delete Document",
description: "Deletes a specific document. [See the documentation](https://api.docugenerate.com/#/Document/deleteDocument)",
version: "0.0.1",
type: "action",
props: {
app,
documentId: {
type: "string",
label: "Document",
description: "The ID of the document",
},
Comment on lines +11 to +15
Copy link
Collaborator

@GTFalcao GTFalcao Sep 29, 2025

Choose a reason for hiding this comment

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

Can we add async options to the documentId prop and reuse it as a propDefinition, in the same fashion as was done with templateId?

I see the API allows listing documents, so this shouldn't be a problem, and would make for much better usability

Copy link
Contributor Author

@docugenerate docugenerate Sep 29, 2025

Choose a reason for hiding this comment

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

Thank you, @GTFalcao this is highly appreciated!

For the documentId we'd like to keep it as is if possible. The number of templates is usually reasonably small, so a dropdown for the templates is a great UX choice. However, there can be a lot of generated documents for a given template, so just using the ID for documents is simpler. Hope this makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see @docugenerate , no problem. Pipedream's workflow UI has a search filter to help narrow down the options precisely for these large options.

Should you ever add pagination or a query/search parameter, both of these are supported in our options model as well.

In any case, we can leave it as it is if you believe it is fine for your use case. I'll move the PR forward to QA

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, thank you @GTFalcao! Appreciate your help with getting our PR merged 👍

},
async run({ $ }) {
const response = await this.app.deleteDocument($, this.documentId);

$.export("$summary", `Successfully deleted the document ${this.documentId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-delete-template",
name: "Delete Template",
description: "Deletes a specific template. [See the documentation](https://api.docugenerate.com/#/Template/deleteTemplate)",
version: "0.0.1",
type: "action",
props: {
app,
templateId: {
propDefinition: [
app,
"templateId",
],
},
},
async run({ $ }) {
const response = await this.app.deleteTemplate($, this.templateId);

$.export("$summary", `Successfully deleted the template ${this.templateId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-generate-document",
name: "Generate Document",
description: "Generates a document from a template. [See the documentation](https://api.docugenerate.com/#/Document/generateDocument)",
version: "0.0.1",
type: "action",
props: {
app,
templateId: {
propDefinition: [
app,
"templateId",
],
},
name: {
type: "string",
label: "Name",
description: "Name of the generated document. Defaults to the template’s name.",
optional: true,
},
format: {
type: "string",
label: "Format",
description: "Output format of the generated document. Defaults to .docx.",
optional: true,
options: [
{
label: "PDF (.pdf)",
value: ".pdf",
},
{
label: "Microsoft Word (.docx)",
value: ".docx",
},
{
label: "Microsoft Word 2007 (.doc)",
value: ".doc",
},
{
label: "OpenDocument Format (.odt)",
value: ".odt",
},
{
label: "Plain Text (.txt)",
value: ".txt",
},
{
label: "PNG (.png)",
value: ".png",
},
],
},
data: {
type: "object",
label: "Data",
description: "Data that is used to generate the document.",
},
},
async run({ $ }) {
const body = {
template_id: this.templateId,
name: this.name,
output_format: this.format,
data: this.data,
};

const response = await this.app.generateDocument($, body);

$.export("$summary", `Successfully generated the document ${response.id}`);
return response;
},
};
23 changes: 23 additions & 0 deletions components/docugenerate/actions/get-document/get-document.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-get-document",
name: "Get Document",
description: "Retrieves a specific document. [See the documentation](https://api.docugenerate.com/#/Document/getDocument)",
version: "0.0.1",
type: "action",
props: {
app,
documentId: {
type: "string",
label: "Document",
description: "The ID of the document",
},
},
async run({ $ }) {
const response = await this.app.getDocument($, this.documentId);

$.export("$summary", `Successfully retrieved the document ${this.documentId}`);
return response;
},
};
24 changes: 24 additions & 0 deletions components/docugenerate/actions/get-template/get-template.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-get-template",
name: "Get Template",
description: "Retrieves a specific template. [See the documentation](https://api.docugenerate.com/#/Template/getTemplate)",
version: "0.0.1",
type: "action",
props: {
app,
templateId: {
propDefinition: [
app,
"templateId",
],
},
},
async run({ $ }) {
const response = await this.app.getTemplate($, this.templateId);

$.export("$summary", `Successfully retrieved the template ${this.templateId}`);
return response;
},
};
24 changes: 24 additions & 0 deletions components/docugenerate/actions/list-documents/list-documents.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-list-documents",
name: "List Documents",
description: "Retrieves a list of documents generated from a template. [See the documentation](https://api.docugenerate.com/#/Document/queryDocuments)",
version: "0.0.1",
type: "action",
props: {
app,
templateId: {
propDefinition: [
app,
"templateId",
],
},
},
async run({ $ }) {
const response = await this.app.listDocuments($, this.templateId);

$.export("$summary", `Successfully retrieved ${response?.length || 0} documents`);
return response;
},
};
18 changes: 18 additions & 0 deletions components/docugenerate/actions/list-templates/list-templates.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-list-templates",
name: "List Templates",
description: "Retrieves a list of all templates. [See the documentation](https://api.docugenerate.com/#/Template/queryTemplates)",
version: "0.0.1",
type: "action",
props: {
app,
},
async run({ $ }) {
const response = await this.app.listTemplates($);

$.export("$summary", `Successfully retrieved ${response?.length || 0} templates`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import app from "../../docugenerate.app.mjs";

export default {
key: "docugenerate-update-document",
name: "Update Document",
description: "Updates a specific document. [See the documentation](https://api.docugenerate.com/#/Document/updateDocument)",
version: "0.0.1",
type: "action",
props: {
app,
documentId: {
type: "string",
label: "Document",
description: "The ID of the document",
},
name: {
type: "string",
label: "Name",
description: "The new name for the document",
},
},
async run({ $ }) {
const response = await this.app.updateDocument($, this.documentId, {
name: this.name,
});

$.export("$summary", `Successfully updated the document ${this.documentId}`);
return response;
},
};
98 changes: 93 additions & 5 deletions components/docugenerate/docugenerate.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,99 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "docugenerate",
propDefinitions: {},
propDefinitions: {
templateId: {
type: "string",
label: "Template",
description: "The selected template",
async options() {
const response = await this.listTemplates();
return response.map((template) => ({
label: template.name,
value: template.id,
}));
},
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
getBaseUrl() {
return "https://api.docugenerate.com/v1";
},
getHeaders() {
return {
"Authorization": `${this.$auth.api_key}`,
"Content-Type": "application/json",
};
},
async makeRequest({
$ = this,
method = "GET",
path,
...args
}) {
const config = {
method,
url: `${this.getBaseUrl()}${path}`,
headers: this.getHeaders(),
...args,
};
return axios($, config);
},
async listTemplates($ = this) {
return this.makeRequest({
$,
path: "/template",
});
},
async getTemplate($ = this, templateId) {
return this.makeRequest({
$,
path: `/template/${templateId}`,
});
},
async deleteTemplate($ = this, templateId) {
return this.makeRequest({
$,
method: "DELETE",
path: `/template/${templateId}`,
});
},
async listDocuments($ = this, templateId) {
return this.makeRequest({
$,
path: `/document?template_id=${templateId}`,
});
},
async getDocument($ = this, documentId) {
return this.makeRequest({
$,
path: `/document/${documentId}`,
});
},
async updateDocument($ = this, documentId, body) {
return this.makeRequest({
$,
method: "PUT",
path: `/document/${documentId}`,
data: body,
});
},
async deleteDocument($ = this, documentId) {
return this.makeRequest({
$,
method: "DELETE",
path: `/document/${documentId}`,
});
},
async generateDocument($ = this, body) {
return this.makeRequest({
$,
method: "POST",
path: "/document",
data: body,
});
},
},
};
};
Loading