|
51 | 51 | inputType: `{ |
52 | 52 | url: string |
53 | 53 | }`, |
54 | | - steps: ['fetch_article', 'summarize', 'extract_keywords', 'publish'] |
| 54 | + steps: ['fetchArticle', 'summarize', 'extractKeywords', 'publish'] |
55 | 55 | }; |
56 | 56 |
|
57 | 57 | // Step-level concept explanations (how pgflow works internally) |
58 | 58 | const stepConcepts: Record<string, string> = { |
59 | | - fetch_article: |
| 59 | + fetchArticle: |
60 | 60 | "This is a root step with no dependencies. When start_flow() is called, SQL Core immediately " + |
61 | 61 | "pushes a message to the queue. The Worker polls, gets the message, executes the handler, " + |
62 | 62 | "and calls complete_task() with the return value. SQL Core acknowledges completion, saves the output, " + |
63 | 63 | "and checks which dependent steps now have all their dependencies satisfied.", |
64 | 64 |
|
65 | 65 | summarize: |
66 | | - "Depends on fetch_article. After fetch_article completes, SQL Core checks if this step's " + |
67 | | - "dependencies are met. Since fetch_article is the only dependency, this step becomes ready " + |
68 | | - "immediately. SQL Core pushes a message with the input payload (fetch_article's output). " + |
| 66 | + "Depends on fetchArticle. After fetchArticle completes, SQL Core checks if this step's " + |
| 67 | + "dependencies are met. Since fetchArticle is the only dependency, this step becomes ready " + |
| 68 | + "immediately. SQL Core pushes a message with the input payload (fetchArticle's output). " + |
69 | 69 | "Worker polls, executes the handler, calls complete_task(). SQL Core acknowledges completion and saves output.", |
70 | 70 |
|
71 | | - extract_keywords: |
72 | | - "Also depends only on fetch_article, so it becomes ready at the same time as summarize. " + |
| 71 | + extractKeywords: |
| 72 | + "Also depends only on fetchArticle, so it becomes ready at the same time as summarize. " + |
73 | 73 | "Both messages hit the queue simultaneously - whichever Worker polls first starts execution. " + |
74 | 74 | "This is how pgflow achieves parallel execution: SQL Core identifies ready steps and pushes messages, " + |
75 | 75 | "Workers execute independently.", |
76 | 76 |
|
77 | 77 | publish: |
78 | | - "Depends on both summarize AND extract_keywords. This step remains blocked until both " + |
| 78 | + "Depends on both summarize AND extractKeywords. This step remains blocked until both " + |
79 | 79 | "dependencies complete. After the second one finishes, complete_task() acknowledges completion, " + |
80 | 80 | "saves output, checks dependencies, and finds publish is now ready. SQL Core pushes the message " + |
81 | 81 | "with both outputs as input. After publish completes, no dependent steps remain - the run is marked completed." |
|
94 | 94 | returns: string; |
95 | 95 | } |
96 | 96 | > = { |
97 | | - fetch_article: { |
98 | | - name: 'fetch_article', |
| 97 | + fetchArticle: { |
| 98 | + name: 'fetchArticle', |
99 | 99 | displayName: 'Fetch Article', |
100 | 100 | whatItDoes: |
101 | 101 | 'Fetches article content from the provided URL using r.jina.ai. Returns both the article text and title for downstream processing.', |
102 | 102 | dependsOn: [], |
103 | | - dependents: ['summarize', 'extract_keywords'], |
| 103 | + dependents: ['summarize', 'extractKeywords'], |
104 | 104 | inputType: `{ |
105 | 105 | run: { |
106 | 106 | url: string |
|
116 | 116 | displayName: 'Summarize', |
117 | 117 | whatItDoes: |
118 | 118 | 'Uses an LLM (Groq) to generate a concise summary of the article content. Runs in parallel with keyword extraction for efficiency.', |
119 | | - dependsOn: ['fetch_article'], |
| 119 | + dependsOn: ['fetchArticle'], |
120 | 120 | dependents: ['publish'], |
121 | 121 | inputType: `{ |
122 | | - fetch_article: { |
| 122 | + fetchArticle: { |
123 | 123 | content: string |
124 | 124 | title: string |
125 | 125 | } |
126 | 126 | }`, |
127 | 127 | returns: 'string' |
128 | 128 | }, |
129 | | - extract_keywords: { |
130 | | - name: 'extract_keywords', |
| 129 | + extractKeywords: { |
| 130 | + name: 'extractKeywords', |
131 | 131 | displayName: 'Extract Keywords', |
132 | 132 | whatItDoes: |
133 | 133 | 'Uses an LLM (Groq) to extract key terms and topics from the article. Runs in parallel with summarization for efficiency.', |
134 | | - dependsOn: ['fetch_article'], |
| 134 | + dependsOn: ['fetchArticle'], |
135 | 135 | dependents: ['publish'], |
136 | 136 | inputType: `{ |
137 | | - fetch_article: { |
| 137 | + fetchArticle: { |
138 | 138 | content: string |
139 | 139 | } |
140 | 140 | }`, |
|
145 | 145 | displayName: 'Publish', |
146 | 146 | whatItDoes: |
147 | 147 | 'Combines the summary and keywords and publishes the processed article. In this demo, generates a mock article ID—in production, this would save to a database.', |
148 | | - dependsOn: ['summarize', 'extract_keywords'], |
| 148 | + dependsOn: ['summarize', 'extractKeywords'], |
149 | 149 | dependents: [], |
150 | 150 | inputType: `{ |
151 | 151 | summarize: string |
152 | | - extract_keywords: string[] |
| 152 | + extractKeywords: string[] |
153 | 153 | }`, |
154 | 154 | returns: 'string' |
155 | 155 | } |
|
0 commit comments