Titan Core
  • Overview
  • Getting Started
  • Working With Resources
  • Blueprint
  • GitHub Action
  • Resources
    • APIAuthenticationSecurityIntegration
    • APIIntegration
    • AccountParameter
    • AggregationPolicy
    • Alert
    • AuthenticationPolicy
    • AzureStorageIntegration
    • ComputePool
    • Database
    • DatabaseRole
    • DynamicTable
    • EmailNotificationIntegration
    • EventTable
    • ExternalAccessIntegration
    • ExternalStage
    • FailoverGroup
    • FutureGrant
    • GCSStorageIntegration
    • GenericSecret
    • GlueCatalogIntegration
    • Grant
    • GrantOnAll
    • HybridTable
    • ImageRepository
    • InternalStage
    • JSONFileFormat
    • JavascriptUDF
    • MaterializedView
    • NetworkPolicy
    • NetworkRule
    • OAuthSecret
    • ObjectStoreCatalogIntegration
    • PackagesPolicy
    • ParquetFileFormat
    • PasswordPolicy
    • PasswordSecret
    • Pipe
    • PythonStoredProcedure
    • PythonUDF
    • ReplicationGroup
    • ResourceMonitor
    • Role
    • RoleGrant
    • S3StorageIntegration
    • Schema
    • Sequence
    • Service
    • SessionPolicy
    • Share
    • SnowflakePartnerOAuthSecurityIntegration
    • SnowservicesOAuthSecurityIntegration
    • StageStream
    • Table
    • TableStream
    • Tag
    • Task
    • User
    • View
    • ViewStream
    • Warehouse
Powered by GitBook
On this page
  • Examples
  • Python
  • YAML
  • Fields
  1. Resources

Task

PreviousTagNextUser

Last updated 11 months ago

Represents a scheduled task in Snowflake that performs a specified SQL statement at a recurring interval.

Examples

Python

task = Task(
    name="some_task",
    warehouse="some_warehouse",
    schedule="USING CRON 0 9 * * * UTC",
    state="SUSPENDED",
    as_="SELECT 1"
)

YAML

tasks:
  - name: some_task
    warehouse: some_warehouse
    schedule: "USING CRON 0 9 * * * UTC"
    state: SUSPENDED
    as_: |
        SELECT 1

Fields

  • schedule (string) - The schedule on which the task runs.

  • config (string) - Configuration settings for the task.

  • allow_overlapping_execution (bool) - Whether the task can have overlapping executions.

  • user_task_timeout_ms (int) - The timeout in milliseconds after which the task is aborted.

  • suspend_task_after_num_failures (int) - The number of consecutive failures after which the task is suspended.

  • error_integration (string) - The integration used for error handling.

  • copy_grants (bool) - Whether to copy grants from the referenced objects.

  • comment (string) - A comment for the task.

  • after (list) - A list of tasks that must be completed before this task runs.

  • when (string) - A conditional expression that determines when the task runs.

  • as_ (string) - The SQL statement that the task executes.

warehouse (string or ) - The warehouse used by the task.

user_task_managed_initial_warehouse_size (string or ) - The initial warehouse size when the task is managed by the user. Defaults to None.

state (string or , required) - The initial state of the task. Defaults to SUSPENDED.

Snowflake Documentation
Warehouse
WarehouseSize
TaskState