<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Relational_Data_Query_Node_in_Pathways</id>
	<title>Relational Data Query Node in Pathways - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Relational_Data_Query_Node_in_Pathways"/>
	<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Relational_Data_Query_Node_in_Pathways&amp;action=history"/>
	<updated>2026-06-22T03:25:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://docs.foji.io/index.php?title=Relational_Data_Query_Node_in_Pathways&amp;diff=2761&amp;oldid=prev</id>
		<title>Mitchell.Hirsche: Mitchell.Hirsche moved page Documentation for the &quot;Relational Data Query&quot; Node in Pathways to Relational Data Query Node in Pathways</title>
		<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Relational_Data_Query_Node_in_Pathways&amp;diff=2761&amp;oldid=prev"/>
		<updated>2025-03-05T23:04:54Z</updated>

		<summary type="html">&lt;p&gt;Mitchell.Hirsche moved page &lt;a href=&quot;/wiki/Documentation_for_the_%22Relational_Data_Query%22_Node_in_Pathways&quot; class=&quot;mw-redirect&quot; title=&quot;Documentation for the &amp;quot;Relational Data Query&amp;quot; Node in Pathways&quot;&gt;Documentation for the &amp;quot;Relational Data Query&amp;quot; Node in Pathways&lt;/a&gt; to &lt;a href=&quot;/wiki/Relational_Data_Query_Node_in_Pathways&quot; title=&quot;Relational Data Query Node in Pathways&quot;&gt;Relational Data Query Node in Pathways&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:04, 5 March 2025&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wiki:diff::1.12:old-2637:rev-2761 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mitchell.Hirsche</name></author>
	</entry>
	<entry>
		<id>https://docs.foji.io/index.php?title=Relational_Data_Query_Node_in_Pathways&amp;diff=2637&amp;oldid=prev</id>
		<title>Mitchell.Hirsche: Relational Data Query</title>
		<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Relational_Data_Query_Node_in_Pathways&amp;diff=2637&amp;oldid=prev"/>
		<updated>2025-03-04T23:35:48Z</updated>

		<summary type="html">&lt;p&gt;Relational Data Query&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;Relational Data Query&amp;#039;&amp;#039;&amp;#039; node in FojiSoft Pathways enables workflows to retrieve data from a relational database and store the results in a variable for further processing. This node supports dynamic query customization using either &amp;#039;&amp;#039;&amp;#039;Handlebars Templates&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Scripts&amp;#039;&amp;#039;&amp;#039;, making it a versatile tool for data-driven workflows.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Node Properties&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;1. Name&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: A unique identifier for the node within the workflow.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Provide a clear, descriptive name to indicate the purpose of the query (e.g., &amp;quot;Fetch Pending Claims&amp;quot; or &amp;quot;Retrieve Customer Data&amp;quot;).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;#039;&amp;#039;&amp;#039;&amp;quot;Get Unpaid Invoices&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;2. Variable Name&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: The name of the variable where the query results will be stored.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Use a meaningful name to make the variable easy to reference in downstream nodes.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;#039;&amp;#039;&amp;#039;unpaid_invoices&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;3. Query&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: The SQL-like query used to fetch data from a relational database.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Write a valid query to retrieve the necessary data. The query can be parameterized using dynamic values defined in the &amp;#039;&amp;#039;&amp;#039;Query Parameters&amp;#039;&amp;#039;&amp;#039; section.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM invoices WHERE status = &amp;#039;Unpaid&amp;#039; AND due_date &amp;lt; NOW()&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Query Parameters&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Query Parameters&amp;#039;&amp;#039;&amp;#039; section allows you to define dynamic values for use within the query. These parameters can be configured using either &amp;#039;&amp;#039;&amp;#039;Handlebars Templates&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Scripts&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;3.1 Name&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: Assigns a name to the parameter used within the query.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Use descriptive names that clarify the purpose of the parameter (e.g., Status, StartDate, EndDate).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;#039;&amp;#039;&amp;#039;InvoiceStatus&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;3.2 Expression&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039;: Handlebar Template or Script&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: Defines the value of the parameter dynamically.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Options&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Handlebar Template&amp;#039;&amp;#039;&amp;#039;: Use placeholders to inject dynamic values into the query.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{status}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Where status is a variable from the workflow.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Script&amp;#039;&amp;#039;&amp;#039;: Write custom logic to generate or calculate the parameter value.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039; (Script):&lt;br /&gt;
&lt;br /&gt;
if overdue:&lt;br /&gt;
&lt;br /&gt;
   return &amp;quot;Unpaid&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else:&lt;br /&gt;
&lt;br /&gt;
   return &amp;quot;Paid&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Expression Field&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;: Required.&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Define the logic or value for each parameter to dynamically adapt the query.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;How It Works&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Define Query&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Write a SQL-like query in the &amp;#039;&amp;#039;&amp;#039;Query&amp;#039;&amp;#039;&amp;#039; field, using placeholders for dynamic parameters if needed.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Add Query Parameters&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Define each parameter using either a &amp;#039;&amp;#039;&amp;#039;Handlebar Template&amp;#039;&amp;#039;&amp;#039; or a &amp;#039;&amp;#039;&amp;#039;Script&amp;#039;&amp;#039;&amp;#039; to provide dynamic values.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Execute Query&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* When the node is reached in the workflow, the query is executed, and the results are stored in the variable defined in the &amp;#039;&amp;#039;&amp;#039;Variable Name&amp;#039;&amp;#039;&amp;#039; field.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Use Results&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* The results stored in the variable can be referenced in downstream nodes for further processing, such as loops, notifications, or data updates.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Use Case Examples&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;1. Retrieve Overdue Payments&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: Fetch Overdue Payments&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Variable Name&amp;#039;&amp;#039;&amp;#039;: overdue_payments&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Query&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM invoices WHERE due_date &amp;lt; NOW() AND status = &amp;lt;nowiki&amp;gt;{{status}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Query Parameters&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: status&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039; (Handlebars): &amp;lt;nowiki&amp;gt;{{payment_status}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Outcome&amp;#039;&amp;#039;&amp;#039;: Retrieves all overdue payments and stores them in the overdue_payments variable for further processing.&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;2. Fetch Recent Orders&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: Get Recent Orders&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Variable Name&amp;#039;&amp;#039;&amp;#039;: recent_orders&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Query&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM orders WHERE order_date BETWEEN &amp;lt;nowiki&amp;gt;{{start_date}}&amp;lt;/nowiki&amp;gt; AND &amp;lt;nowiki&amp;gt;{{end_date}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Query Parameters&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: start_date&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039; (Script):&lt;br /&gt;
&lt;br /&gt;
return today() - timedelta(days=30)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: end_date&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039; (Handlebars): &amp;lt;nowiki&amp;gt;{{current_date}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Outcome&amp;#039;&amp;#039;&amp;#039;: Retrieves all orders placed in the last 30 days and stores the results in the recent_orders variable.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Best Practices&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Parameterize Queries&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Use query parameters to make queries adaptable and reduce hardcoding.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Use Descriptive Names&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Clearly name the variable and parameters to make the workflow easier to maintain.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Validate Queries&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Test queries independently to ensure they return the expected results before integrating them into workflows.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Optimize Queries&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Limit the number of rows retrieved by adding constraints to improve performance.&lt;br /&gt;
&lt;br /&gt;
----The &amp;#039;&amp;#039;&amp;#039;Relational Data Query&amp;#039;&amp;#039;&amp;#039; node is an essential component in Pathways, enabling dynamic data retrieval for workflows. Its flexibility to use either Handlebar Templates or Scripts for parameterization ensures adaptability for a wide range of use cases.&lt;br /&gt;
[[Category:ForgeAI]]&lt;br /&gt;
[[Category:Pathways]]&lt;/div&gt;</summary>
		<author><name>Mitchell.Hirsche</name></author>
	</entry>
</feed>