{"id":9465,"date":"2025-11-05T09:55:50","date_gmt":"2025-11-05T09:55:50","guid":{"rendered":"https:\/\/www.process.st\/help\/?post_type=ht_kb&#038;p=9465"},"modified":"2025-11-05T10:11:44","modified_gmt":"2025-11-05T10:11:44","slug":"ai-task-versus-code-task","status":"publish","type":"ht_kb","link":"https:\/\/www.process.st\/help\/docs\/ai-task-versus-code-task\/","title":{"rendered":"When to Use an AI Task versus a Code Task"},"content":{"rendered":"<p data-start=\"410\" data-end=\"542\">Process Street gives you two powerful ways to automate logic and decisions inside your workflows: <a href=\"https:\/\/www.process.st\/help\/docs\/ai-tasks\/\">AI Tasks<\/a> and <a href=\"https:\/\/www.process.st\/help\/docs\/code-task\/\">Code Tasks<\/a>.<\/p>\n<p data-start=\"544\" data-end=\"746\">Both can process data, make decisions, and generate outputs, but they work in very different ways. Understanding which one to use will help you design accurate and reliable workflows.<\/p>\n<h3 data-start=\"753\" data-end=\"814\"><strong data-start=\"757\" data-end=\"814\">AI Tasks: Great for Reasoning and Language-Based Work<\/strong><\/h3>\n<p data-start=\"816\" data-end=\"1032\"><a href=\"https:\/\/www.process.st\/help\/docs\/ai-tasks\/\">AI Tasks<\/a> use large language models (LLMs) to understand, interpret, and generate text.<\/p>\n<p data-start=\"816\" data-end=\"1032\">They\u2019re best suited for subjective, flexible, or context-based work that requires reasoning rather than hard rules.<\/p>\n<p data-start=\"1034\" data-end=\"1081\">Use an AI Task when your workflow needs to:<\/p>\n<ul>\n<li data-start=\"1085\" data-end=\"1136\">Summarize, extract, or interpret natural language<\/li>\n<li data-start=\"1139\" data-end=\"1208\">Generate or classify text (emails, reports, descriptions, insights)<\/li>\n<li data-start=\"1211\" data-end=\"1298\">Make a judgment call or pattern-based decision (e.g. sentiment, intent, risk rating)<\/li>\n<li data-start=\"1301\" data-end=\"1333\">Fill gaps in unstructured data<\/li>\n<li data-start=\"1336\" data-end=\"1380\">Automate repetitive writing or reading tasks<\/li>\n<\/ul>\n<p data-start=\"1382\" data-end=\"1577\">Because AI models are probabilistic, you may see slightly different outputs even with the same input. That\u2019s expected.<\/p>\n<p data-start=\"1579\" data-end=\"1601\"><strong data-start=\"1579\" data-end=\"1601\">Example use cases:<\/strong><\/p>\n<ul>\n<li data-start=\"1604\" data-end=\"1666\">Summarizing a customer feedback comment into a short insight<\/li>\n<li data-start=\"1669\" data-end=\"1713\">Extracting key terms from a legal document<\/li>\n<li data-start=\"1716\" data-end=\"1777\">Generating an onboarding email based on role and department<\/li>\n<li data-start=\"1780\" data-end=\"1828\">Classifying a support ticket\u2019s tone or urgency<\/li>\n<\/ul>\n<p>A Code Task is a better fit if you need identical outputs every time.<\/p>\n<h3 data-start=\"1835\" data-end=\"1893\"><strong data-start=\"1839\" data-end=\"1893\">Code Tasks: Great for Precision and Predictability<\/strong><\/h3>\n<p data-start=\"1895\" data-end=\"2069\"><a href=\"https:\/\/www.process.st\/help\/docs\/code-task\/\">Code Tasks<\/a> execute scripts in JavaScript using exact, deterministic logic. They\u2019re best when accuracy must be 100% consistent every time a workflow runs.<\/p>\n<p data-start=\"2071\" data-end=\"2119\">Use a Code Task when your workflow needs to:<\/p>\n<ul>\n<li data-start=\"2123\" data-end=\"2173\">Calculate, compare, or transform structured data<\/li>\n<li data-start=\"2176\" data-end=\"2224\">Validate inputs or apply strict business rules<\/li>\n<li data-start=\"2227\" data-end=\"2291\">Connect to APIs or external systems where output must not vary<\/li>\n<li data-start=\"2294\" data-end=\"2350\">Handle numeric or boolean logic (\u201cif this, then that\u201d)<\/li>\n<li data-start=\"2353\" data-end=\"2401\">Guarantee identical results for the same input<\/li>\n<\/ul>\n<p data-start=\"2403\" data-end=\"2425\"><strong data-start=\"2403\" data-end=\"2425\">Example use cases:<\/strong><\/p>\n<ul>\n<li data-start=\"2428\" data-end=\"2478\">Checking if a due date is within the next 7 days<\/li>\n<li data-start=\"2481\" data-end=\"2515\">Calculating tax or pricing logic<\/li>\n<li data-start=\"2518\" data-end=\"2553\">Validating data before submission<\/li>\n<li data-start=\"2556\" data-end=\"2596\">Sending data to an external system API<\/li>\n<\/ul>\n<h3 data-start=\"2603\" data-end=\"2639\"><strong data-start=\"2607\" data-end=\"2639\">Choosing the Right Task Type<\/strong><\/h3>\n<div class=\"_tableContainer_1rjym_1\">\n<div class=\"group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse\" tabindex=\"-1\">\n<table class=\"w-fit min-w-(--thread-content-width)\" style=\"height: 205px;\" width=\"908\" data-start=\"2641\" data-end=\"3296\">\n<thead data-start=\"2641\" data-end=\"2685\">\n<tr data-start=\"2641\" data-end=\"2685\">\n<th data-start=\"2641\" data-end=\"2656\" data-col-size=\"md\"><strong data-start=\"2643\" data-end=\"2655\">Use Case<\/strong><\/th>\n<th data-start=\"2656\" data-end=\"2674\" data-col-size=\"sm\"><strong data-start=\"2658\" data-end=\"2673\">Best Option<\/strong><\/th>\n<th data-start=\"2674\" data-end=\"2685\" data-col-size=\"md\"><strong data-start=\"2676\" data-end=\"2683\">Why<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"2733\" data-end=\"3296\">\n<tr data-start=\"2733\" data-end=\"2827\">\n<td data-start=\"2733\" data-end=\"2768\" data-col-size=\"md\">Parsing or summarizing free text<\/td>\n<td data-start=\"2768\" data-end=\"2782\" data-col-size=\"sm\"><strong data-start=\"2770\" data-end=\"2781\">AI Task<\/strong><\/td>\n<td data-start=\"2782\" data-end=\"2827\" data-col-size=\"md\">Handles natural language with flexibility<\/td>\n<\/tr>\n<tr data-start=\"2828\" data-end=\"2922\">\n<td data-start=\"2828\" data-end=\"2867\" data-col-size=\"md\">Enforcing strict validation or rules<\/td>\n<td data-start=\"2867\" data-end=\"2883\" data-col-size=\"sm\"><strong data-start=\"2869\" data-end=\"2882\">Code Task<\/strong><\/td>\n<td data-start=\"2883\" data-end=\"2922\" data-col-size=\"md\">Predictable, deterministic outcomes<\/td>\n<\/tr>\n<tr data-start=\"2923\" data-end=\"3018\">\n<td data-start=\"2923\" data-end=\"2969\" data-col-size=\"md\">Automating creative or judgment-based tasks<\/td>\n<td data-start=\"2969\" data-end=\"2983\" data-col-size=\"sm\"><strong data-start=\"2971\" data-end=\"2982\">AI Task<\/strong><\/td>\n<td data-start=\"2983\" data-end=\"3018\" data-col-size=\"md\">Can reason and adapt to context<\/td>\n<\/tr>\n<tr data-start=\"3019\" data-end=\"3098\">\n<td data-start=\"3019\" data-end=\"3050\" data-col-size=\"md\">Data transformations or math<\/td>\n<td data-start=\"3050\" data-end=\"3066\" data-col-size=\"sm\"><strong data-start=\"3052\" data-end=\"3065\">Code Task<\/strong><\/td>\n<td data-start=\"3066\" data-end=\"3098\" data-col-size=\"md\">Exact, reliable calculations<\/td>\n<\/tr>\n<tr data-start=\"3099\" data-end=\"3191\">\n<td data-start=\"3099\" data-end=\"3135\" data-col-size=\"md\">Workflow needs to adapt over time<\/td>\n<td data-start=\"3135\" data-end=\"3149\" data-col-size=\"sm\"><strong data-start=\"3137\" data-end=\"3148\">AI Task<\/strong><\/td>\n<td data-start=\"3149\" data-end=\"3191\" data-col-size=\"md\">Learns from varied inputs and phrasing<\/td>\n<\/tr>\n<tr data-start=\"3192\" data-end=\"3296\">\n<td data-start=\"3192\" data-end=\"3234\" data-col-size=\"md\">Workflow must always behave identically<\/td>\n<td data-start=\"3234\" data-end=\"3250\" data-col-size=\"sm\"><strong data-start=\"3236\" data-end=\"3249\">Code Task<\/strong><\/td>\n<td data-start=\"3250\" data-end=\"3296\" data-col-size=\"md\">Same output for the same input, every time<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3 data-start=\"3303\" data-end=\"3321\"><strong data-start=\"3307\" data-end=\"3321\">Design Tip<\/strong><\/h3>\n<p data-start=\"3323\" data-end=\"3512\">If the workflow\u2019s success depends on exact, repeatable results, start with a Code Task.<\/p>\n<p data-start=\"3323\" data-end=\"3512\">If the workflow depends on understanding or generating text, start with an AI Task.<\/p>\n<p data-start=\"3514\" data-end=\"3659\">For complex workflows, combine them. For example, use an AI Task to interpret an answer and then a Code Task to validate or act on it.<\/p>\n<h3 data-start=\"3666\" data-end=\"3687\"><strong data-start=\"3670\" data-end=\"3687\">Key Takeaways<\/strong><\/h3>\n<ul>\n<li data-start=\"3691\" data-end=\"3783\">AI Tasks are <strong data-start=\"3704\" data-end=\"3721\">probabilistic<\/strong> \u2014 perfect for flexible reasoning and natural language work.<\/li>\n<li data-start=\"3786\" data-end=\"3861\">Code Tasks are <strong data-start=\"3801\" data-end=\"3818\">deterministic<\/strong> \u2014 perfect for precise, rule-based logic.<\/li>\n<li data-start=\"3864\" data-end=\"3926\">Use AI Tasks for interpretation, Code Tasks for enforcement.<\/li>\n<li data-start=\"3929\" data-end=\"3988\">You can combine both to balance intelligence and control.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Process Street gives you two powerful ways to automate logic and decisions inside your workflows: AI Tasks and Code Tasks. Both can process data, make decisions, and generate outputs, but they work in very different ways. Understanding which one to use will help you design accurate and reliable workflows. AI Tasks: Great for Reasoning and [&hellip;]<\/p>\n","protected":false},"author":11,"template":"","meta":{"_acf_changed":false,"available_plan":"All plans","available_product":"Integrations","footnotes":""},"ht_kb_category":[194],"ht_kb_tag":[495,612],"class_list":["post-9465","ht_kb","type-ht_kb","status-publish","hentry","ht_kb_category-integrations","ht_kb_tag-ai-task","ht_kb_tag-code-task"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/ht_kb\/9465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/users\/11"}],"version-history":[{"count":2,"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/ht_kb\/9465\/revisions"}],"predecessor-version":[{"id":9469,"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/ht_kb\/9465\/revisions\/9469"}],"wp:attachment":[{"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/media?parent=9465"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/ht_kb_category?post=9465"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.process.st\/help\/wp-json\/wp\/v2\/ht_kb_tag?post=9465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}