Workflow
class Workflow
Workflows on Redivis are where analytical pipelines are built and executed. Workflows are owned by a user or an organization, and are made up of datasources, transforms, notebooks, and their output tables.
Constructors
Get the current default workflow. Typically called within notebooks.
Organization$list_workflows([max_results])
List all workflows in the organization.
User$list_workflows([max_results])
List all workflows owned by a user.
Organization$workflow(name)
Construct a new workflow instance that references a workflow owned by an organization.
User$workflow(name)
Construct a new workflow instance that references a workflow owned by a user.
Examples
library("redivis")
workflow <- redivis$user("imathews")$workflow("example_workflow_climate_analysis")
tables <- workflow$list_tables()
for (table in tables){
# Properties will be populated with the table.list resource representation
print(table$properties)
table$get()
# Properties will now be populated with the table.get resource representation
print(table$properties)
}
workflow$table("join_lat_lon_output")$exists() # -> TRUElibrary("redivis")
workflow <- redivis$user("imathews")$workflow("example_workflow_climate_analysis")
query = workflow$query("
SELECT
id,
EXTRACT(YEAR FROM date) AS year,
SUM(value) AS annual_precip
FROM daily_observations
WHERE (element = 'PRCP')
GROUP BY id, year
")
query$to_tibble()
# id year annual_precip
# 0 CA0023026HN 2003 2925.0
# ...Fields
properties
A named list containing the API resource representation of the workflow.
This will be fully populated after calling Workflow$get(), and partially populated for worfklows created via User$list_workflows. Otherwise will be NULL.
qualified_reference
The fully qualified reference for the workflow, which can be used in SQL queries or the REST API. E.g., imathews.example_workflow_climate_analysis:x7kh
organization
A reference to the Organization instance that constructed this workflow.
scoped_reference
The canonical reference for the workflow, without the username qualifier. E.g.,: example_workflow_climate_analysis:x7kh
user
A reference to the User instance that constructed this workflow.
Methods
Create a DBI connection scoped to the workflow.
Workflow$create([description, is_public])
Create a new workflow.
Create a reference to a datasource within the workflow.
Delete the workflow.
Check whether the workflow exists.
Get the workflow, populating the properties attribute on the current instance.
Workflow$list_datasources([max_results])
List all datasources in the workflow.
Workflow$list_notebooks([max_results])
List all notebooks in the workflow.
Workflow$list_parameters([max_results])
List all parameters in the workflow.
Workflow$list_tables([max_results])
List all tables in the workflow.
Workflow$list_transforms([max_results])
List all transforms in the workflow.
Workflow$notebook(name)
Create a reference to a specific notebook within the workflow.
Workflow$parameter(name)
Create a reference to a specific parameter within the workflow.
Workflow$query(query_string)
Create a query scoped to the workflow.
Workflow$table(table_reference)
Create a reference to a specific table within the workflow.
Workflow$transform(name)
Create a reference to a specific transform within the workflow.
Workflow$update_variables(variables)
Bulk update variable metadata across tables in a workflow.
Last updated
Was this helpful?

