Skip to main content

Overview

This use case generates business proposals by searching a knowledge base of historical proposals (via RAG), then using Claude to draft a new proposal based on the requirements document and similar past work.

Folder structure

Workflow architecture

config.ts highlights

Three workflow definitions

Main workflow (HTTP trigger with file upload input)

File input schema

File output schema

Sub-workflow definition

Knowledge base access

This enables the workflow to access tagged documents from both the process-level and instance-level knowledge bases.

Data ingestion configuration

For embedding documents into the vector store:

Key patterns demonstrated

1. Multi-workflow architecture

Three workflows with clear separation of concerns — main generation, retrieval, and PDF conversion.

2. Sub-workflow with file upload

The PDF sub-workflow receives execution metadata from the parent and uses executionIdOverride / executionSecretOverride on the Codika Upload File node.

3. SUBWKFL placeholder

Parent calls sub-workflow via:

4. File input and output

Users upload a document (requirements file), the workflow processes it, generates a PDF, uploads it via Codika Upload File, and returns the documentId as a file type output field.

5. RAG data ingestion

Separate data ingestion workflow embeds documents into Pinecone. Deployed independently via:

6. Knowledge base tags

Documents are filtered by tags, allowing fine-grained access control over which documents the workflow can read.

7. Cost differentiation

Main workflow costs 15 credits, retrieval costs 5, sub-workflow costs 0 (attributed to parent).

Deploy sequence