Civis Platform allows users to create Jobs, Workflows, and more (referred to hereafter as “objects”) that are hidden, limiting their discoverability. Hidden objects do not appear in Global Search or Object Indexes. Hidden objects can be listed using the Civis API endpoint for the appropriate object type, e.g. GET /scripts
While hidden objects behave similarly to Archived objects in many ways, they differ in the following key ways:
- Hidden objects can still be modified, shared, scheduled, and run / executed; archived objects cannot.
- The hidden property is not editable and can be set only on object creation. The archived property can be updated at any time.
- Archived objects are discoverable via Global Search and Object Indexes, hidden objects can only be listed via the Civis API.
The hidden attribute is intended to be used for objects that will be executed or run only once, such as those created automatically from Workflows or child Jobs created by a Script, or those that are not needed for later reference.
For example, the civis.io.read_civis() Civis Python Client function executes a hidden Civis SQL script to retrieve data.
Civis recommends logging links to child objects when creating them in your scripts, especially if you are using the hidden option. https://platform.civisanalytics.com/ URLs in Civis Job logs will be hyperlinked for convenience.
Supported Objects
The following objects have the hidden attribute and can be hidden on creation:
- Jobs
- Workflows
- Templates
- Notebooks
- Projects
- Reports
- Services
Note: Custom Scripts created from hidden Templates are not automatically hidden.
Hiding Jobs created by Workflows
The following Civis Workflow YAML actions will create a new object on each execution:
- civis.scripts.sql - Create / run a SQL script
- civis.scripts.r - Create / run an R script
- civis.scripts.python3 - Create / run a Python script
- civis.scripts.container - Create / run a container script
- civis.scripts.javascript - Create / run a JavaScript script
- civis.scripts.dbt - Create / run a dbt Job
- civis.scripts.custom - Create / run a script from Script Template
- civis.import - Create / run a Civis Database Import
For all of these actions, the input block implements the Civis API, allowing you to pass supported arguments, including hidden. This example Workflow YAML creates a hidden Python3 Script, and a hidden Custom Script created from a Template.
version: '2.0'
workflow:
tasks:
create_hidden_job_from_template:
action: civis.scripts.custom
# the input block for the civis.scripts.custom action
# implements the Civis POST /scripts/custom endpoint.
# https://platform.civisanalytics.com/spa/#/api#post_scripts_custom
# Arguments for that endpoint can be supplied in the input block.
#
input:
from_template_id: 1234
hidden: true
arguments:
SOME_STRING: "This Custom Script is hidden"
create_hidden_job_via_api:
action: civis.scripts.python3
# The input block for the civis.scripts.python3 action
# implements the civis POST /scripts/python3 endpoint
# https://platform.civisanalytics.com/spa/#/api#post_scripts_python3
# Arguments for that endpoint can be supplied in the input block.
# In this example the job is created as hidden
# and memory and CPU settings are configured
input:
source: print("This Python3 Job is hidden")
hidden: true
required_resources:
cpu: 100
memory: 100
Comments
0 comments
Please sign in to leave a comment.