Tasks
Execute SQL scripts in your warehouse, with support for dbt projects, Lambda functions, and more coming soon.
Overview
Tasks allow you to run custom logic directly in your data warehouse. Currently, tasks execute SQL scripts for transformations, aggregations, data quality checks, or any custom operations on your data.
Task types:
- SQL Script (Available now) - Execute SQL statements in your warehouse
- Snowflake dbt (Coming soon) - Run dbt projects directly in Snowflake
- dbt Cloud (Coming soon) - Trigger dbt Cloud jobs via API
- AWS Lambda (Coming soon) - Invoke Lambda functions
- Apache Airflow (Coming soon) - Trigger Airflow DAGs
Common use cases:
- Calculate lead scores after ingesting from Salesforce
- Aggregate event data into summary tables
- Run data quality checks and log anomalies
- Transform raw data into analytics-ready tables
Prerequisites: At least one active warehouse datasource (Snowflake, BigQuery, PostgreSQL, etc.).
To access: Navigate to Tasks in the sidebar, then click + Create Task.
Creating a Task
To start:
- Navigate to Tasks in the sidebar
- Click + Create Task
- The task creation flow opens with 3 steps:
Step 1: Select Task Type
Select SQL Script from the task type grid. Other task types (Snowflake dbt, dbt Cloud, AWS Lambda, Apache Airflow) are coming soon.
To proceed: Click the SQL Script card.
Step 2: Write & Test SQL
Write your SQL script and test it before proceeding.
- Select datasource from the dropdown (shows database, schema, and warehouse info)
- Write SQL in the editor with syntax highlighting
- Click Run to test your SQL
- Verify success - Results section will show execution status
Important: The Next button is only enabled after your SQL executes successfully. You must test your SQL before you can proceed.
What happens when you click Run:
- Task is saved in
draftstate - SQL executes against the selected datasource
- If successful: Task transitions to
activestate - If failed: Task remains in
draftstate
Note: If you abort the flow without clicking Next, the task remains saved in whatever state it's in (draft or active). You'll see it in the tasks list and can edit or delete it later.
To proceed: Click Next after successful execution.
Step 3: Name & Save
Provide a name and optionally add a description.
Task Name (required): Descriptive name for your task (e.g., "Enrich Leads")
API Name (required): Lowercase identifier for API calls and orchestrations (e.g., enrich_leads)
Description (optional): Add notes about what this task does
To create: Click Save Task.
Running a Task
To run manually:
- Navigate to Tasks in the sidebar
- Find your task in the tasks list
- Click the ••• menu → Run Task
The task executes immediately and creates an activity.
Managing Tasks
The tasks list shows all your tasks with columns for NAME, TYPE, DATASOURCE, LAST RUN, and STATE. Click the three-dot menu (•••) on any task row to access management options.
Edit
Modify SQL script, datasource, task name, or description.
To edit: Click ••• → Edit
You'll be redirected to the task editor where you can modify any settings. Click Run to test changes, then Save to apply updates.
Run Task
Manually execute the task.
To run: Click ••• → Run Task
The task runs immediately and creates an activity. This is useful for testing or running tasks on-demand outside of orchestrations.
Delete
Permanently remove the task.
To delete: Click ••• → Delete
⚠️ Warning:
- Deletion is permanent and cannot be undone
- Ensure the task is not used in active orchestrations before deleting
Task States
Tasks can be in one of three states:
| State | Description | How It Happens |
|---|---|---|
| draft | Task saved but SQL hasn't run successfully yet | Created when you click Run before SQL succeeds, or when SQL execution fails |
| active | Task tested and ready to use in orchestrations | SQL executed successfully |
| inactive | Task disabled by user | You clicked Disable from the menu |
State transitions:
- Clicking Run in the SQL editor saves the task in
draftstate - Successful SQL execution transitions the task to
activestate - Failed SQL execution keeps the task in
draftstate - You can disable an
activetask to make itinactive
Note: Draft tasks appear in your tasks list even if you didn't complete the wizard. You can edit, run, or delete them anytime.
Troubleshooting
SQL Execution Fails
Problem: Task shows failed status.
Solution: Review the error message. Common causes include syntax errors, permission issues, missing tables, or timeouts. Test SQL in your warehouse query editor first to verify it runs successfully.
Next Button Disabled
Problem: Cannot proceed from SQL editor step.
Solution: The Next button is only enabled after SQL executes successfully. Click Run to test your SQL and verify it completes without errors.
Task Won't Save
Problem: Cannot save task.
Solution: Ensure task name is not empty, API name is unique within the workspace, and datasource is still active.
Task Used in Orchestration
Problem: Want to delete a task but unsure if it's being used.
Solution: Check Orchestrations page to see if the task is used in any orchestrations. Remove it from orchestrations before deleting.
Related Pages
- Orchestrations - Chain tasks with pipelines
- Activities - View task execution history
- Schedules - Automate orchestrations with tasks
Support
Need help? Contact us at support@supa-flow.io