Tasks
albert.collections.tasks.TaskCollection
Bases: BaseCollection
Manage Tasks in the Albert platform.
A Task is a unit of lab work. There are three kinds, and choosing the right one matters:
- PropertyTask: test and document the properties of products/formulas or raw materials. This is the task type that captures measured Property Data. A PropertyTask holds one or more Blocks, each pairing a Data Template (the results to capture) with a Workflow (the conditions to run under).
- BatchTask: manufacture a batch within Albert after creating a new formulation.
- GeneralTask: anything else happening in the lab that is not a batch or property task (e.g. equipment calibration). Has no blocks.
Typical PropertyTask flow: create the task, attach a Block with
add_block (a Data Template + a Workflow), then record results through
the Property Data collection
(PropertyDataCollection). Measured
results roll up to the associated inventory item's properties.
This collection is accessed as client.tasks.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for task requests. |
Methods:
| Name | Description |
|---|---|
create |
Create a PropertyTask, BatchTask, or GeneralTask. |
create_many |
Create multiple tasks in a single call. |
create_with_combinations |
Create a Property task and generate its block combinations (increased intervals). |
get_by_id |
Get a single fully populated task by its ID. |
search |
Fast, lightweight search returning partial tasks. |
get_all |
Same filters as search, but returns fully populated tasks. |
update |
Update an existing task. |
delete |
Delete a task by its ID. |
add_block |
Add a Block (Data Template + Workflow) to a Property or Batch task. |
add_blocks |
Add multiple Blocks to a task in one call. |
remove_block |
Remove a Block from a Property or Batch task. |
update_block_workflow |
Swap the Workflow assigned to a Block. |
get_block_combinations |
Get the child-workflow combinations of a block. |
get_block_rules |
Get combination rules and overrides for a block. |
set_block_rules |
Set combination rules and overrides for a block, automatically regenerating combinations. |
add_block_inventory_exclusions |
Mask inventory x combination pairs on a block. |
remove_block_inventory_exclusions |
Unmask inventory x combination pairs on a block. |
generate_block_combinations |
Generate child-workflow interval combinations for a task block. |
import_results |
Import measured results into a Property task from a file or attachment. |
get_history |
Get a task's audit history. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Source code in src/albert/collections/tasks.py
create
create(
*, task: PropertyTask | GeneralTask | BatchTask
) -> BaseTask
Create a new task.
Pass the concrete task type you want to create. Its category is set
automatically by the type, so the platform routes it correctly:
PropertyTask: test/document properties.BatchTask: manufacture a batch.GeneralTask: any other lab work.
For a PropertyTask, set parent_id to the parent Project ID. Blocks can be
set on the task's blocks or added after creation with
add_block.
Property tasks with increased intervals (🧪 Beta)
When increased intervals is enabled for your tenant, create does not
generate combinations for a Property task's blocks, so those blocks show no
rows. This applies even when a block's workflow has no intervals, because
every block needs at least its baseline combination. Create Property tasks
with blocks using
create_with_combinations
instead, or call
generate_block_combinations
for each block after create. General tasks are not affected.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
PropertyTask or GeneralTask or BatchTask
|
The task to create. |
required |
Returns:
| Type | Description |
|---|---|
BaseTask
|
The created task (a |
Source code in src/albert/collections/tasks.py
create_many
create_many(
*, tasks: list[PropertyTask | GeneralTask | BatchTask]
) -> list[BaseTask]
Create multiple tasks in a single call.
All tasks must share the same category (mixing task types is not
supported) and, when set, the same parent_id.
Property tasks with increased intervals (🧪 Beta)
When increased intervals is enabled for your tenant, create_many does not
generate combinations for Property task blocks, so those blocks show no rows,
even when a block's workflow has no intervals. Call
generate_block_combinations
for each block of each created task, or create tasks one at a time with
create_with_combinations.
Example
from albert.resources.tasks import GeneralTask
location = next(client.locations.get_all(max_items=1))
tasks = client.tasks.create_many(
tasks=[
GeneralTask(name="Calibrate balance", location=location),
GeneralTask(name="Clean hood", location=location),
]
)
[t.id for t in tasks]
# ['TASGEN1', 'TASGEN2']
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tasks
|
list[PropertyTask or GeneralTask or BatchTask]
|
The tasks to create. Must be non-empty and share one category and
one |
required |
Returns:
| Type | Description |
|---|---|
list[BaseTask]
|
The created tasks, in request order, populated with their assigned Task IDs. |
Raises:
| Type | Description |
|---|---|
AlbertException
|
If |
Source code in src/albert/collections/tasks.py
create_with_combinations
create_with_combinations(
*, task: PropertyTask, wait: bool = True
) -> PropertyTask
Create a Property task and generate interval combinations across all its blocks (🧪 Beta).
Use this method instead of
create to create Property
tasks with blocks when increased intervals is enabled for your tenant. Every
block then needs its combinations generated, including blocks whose workflow
has no intervals (a single baseline combination). Only
PropertyTask is supported, and only
when increased intervals is enabled; otherwise the task is rejected and not
created, so use create
instead. Albert enables increased intervals per tenant; if you're unsure
whether it's enabled for yours, contact your Albert representative.
Provides an all-in-one method to create a Property task and materialize child-workflow combination variants across every task block.
Intervals, Modes, Rules, and Overrides:
- Intervals and Cartesian Product: When workflow parameters define discrete setpoints (intervals), Albert computes the Cartesian product across every intervalized parameter. Each combination materializes as an independent child workflow record linked to the task block with a unique, persistent interval barcode.
- Starting Baseline (
intervals_start_from): - Exclude Mode (
"all", default): starts with all possible Cartesian product variants active. Rules and overrides prune out infeasible, unsafe, or unwanted combinations. - Include Mode (
"none"): starts with zero active combinations (an empty set). Rules and overrides selectively pull in combinations, ideal for sparse screening or targeted Designs of Experiment (DoE). - Rules (Criteria-Based Filtering): Rules dynamically evaluate combination variants against criteria defined on parameter values. All conditions within a single rule must match (AND logic). If any rule on the block triggers (OR logic), the combination is excluded (in Exclude Mode) or included (in Include Mode).
- Overrides (Targeted Setpoint Overrides):
Overrides target a single, specific combination identified by its exact parameter values:
action="skip"explicitly excludes the variant, whileaction="unskip"keeps or forces its inclusion. In Include Mode ("none"), setis_manual=Trueto designate a manually cherry-picked combination. Overrides are evaluated first and always take precedence over rules.
Execution Steps:
- Automatically saves any unsaved
Workflowobjects defined on the task blocks, preserving block ordering. - Sets
intervals_start_from="all"(Exclude Mode) on any blocks where the mode is not explicitly configured. - Creates the task and saves any configured block rules (
ExclusionRule) or overrides (CombinationOverride). - Sequentially triggers combination generation for each block, pacing requests to ensure steady platform processing.
- If
wait=True(the default), waits for combination generation to complete across all blocks and returns the refreshed task with combination details populated. Ifwait=False, returns immediately after launching generation, leaving job tracking identifiers on each block.
To view the generated combinations after creation, use
get_block_combinations.
To update rules or regenerate combinations on an existing task later, use
set_block_rules and
generate_block_combinations.
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Example
from albert import Albert
from albert.resources.tasks import Block, PropertyTask
client = Albert()
task = client.tasks.create_with_combinations(
task=PropertyTask(
name="Viscosity screen",
parent_id="PROA123",
blocks=[
Block(
data_template=[{"id": "DAT123"}],
workflow=[{"id": "WFL456"}],
),
],
),
wait=True,
)
task.id
# 'TASFOR1'
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
PropertyTask
|
required | |
wait
|
bool
|
Whether to wait for combination generation to complete across all blocks. If False, returns immediately after submitting generation jobs. |
True
|
Returns:
| Type | Description |
|---|---|
PropertyTask
|
The created Property task. If |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
CombinationGenerationError
|
If |
Source code in src/albert/collections/tasks.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | |
add_block
add_block(
*,
task_id: TaskId,
data_template_id: DataTemplateId,
workflow_id: WorkflowId,
) -> None
Add a Block to a Property or Batch task.
A Block pairs a Data Template (the results/data columns to capture) with a Workflow (the parameter conditions to run under). A task can hold multiple blocks, e.g. one per test. Once a block exists, results are written against it through the Property Data collection.
Increased intervals (🧪 Beta)
When increased intervals is enabled for your tenant, adding a block does not
generate its combinations, so the block shows no rows, even when its workflow
has no intervals. Call
generate_block_combinations
for the added block, leaving old_workflow_id unset.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The task to add the block to (format |
required |
data_template_id
|
DataTemplateId
|
The Data Template supplying the block's results/data columns
(format |
required |
workflow_id
|
WorkflowId
|
The Workflow supplying the block's parameter conditions
(format |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
See Also
remove_block : Remove a block from a task. update_block_workflow : Change the workflow on an existing block.
Source code in src/albert/collections/tasks.py
add_blocks
Add multiple Blocks to a Property or Batch task in one call.
Each Block pairs a Data Template (the results/data columns to capture)
with a Workflow (the parameter conditions to run under), exactly as with
add_block; only
the block's workflow and data template IDs are used.
Increased intervals (🧪 Beta)
When increased intervals is enabled for your tenant, adding blocks does not
generate their combinations, so the blocks show no rows, even when their
workflows have no intervals. Call
generate_block_combinations
for each added block, leaving old_workflow_id unset.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The task to add the blocks to (format |
required |
blocks
|
list[Block]
|
The blocks to add. Build each with a single Workflow and a single Data Template referenced by ID. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
See Also
add_block : Add a single Block to a task. remove_block : Remove a block from a task.
Source code in src/albert/collections/tasks.py
update_block_workflow
update_block_workflow(
*,
task_id: TaskId,
block_id: BlockId,
workflow_id: WorkflowId,
) -> None
Swap the Workflow assigned to a Block within a task.
Use this to change the conditions a block runs under without removing and re-adding the block. The task must be a Property or Batch task.
Increased intervals (🧪 Beta)
When increased intervals is enabled for your tenant, changing a block's
workflow does not regenerate its combinations: the block keeps the
combinations of the previous workflow until you call
generate_block_combinations
with old_workflow_id set to the workflow you replaced. Doing so keeps
interval barcodes for unchanged combinations and removes obsolete ones.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The task containing the block (format |
required |
block_id
|
BlockId
|
The block to update (format |
required |
workflow_id
|
WorkflowId
|
The new Workflow to assign to the block (format |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If the task is not a PropertyTask or BatchTask. |
Notes
If the block already uses workflow_id, no change is made. A block's
default placeholder workflow ("No Parameter Group") is skipped when it is
not the block's only workflow.
Source code in src/albert/collections/tasks.py
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | |
get_block_combinations
get_block_combinations(
*,
task_id: TaskId,
block_id: BlockId,
max_items: int | None = None,
) -> Iterator[IntervalCombinationItem]
Get the child-workflow interval combinations of a task block (🧪 Beta).
Retrieves the combinations generated for a task block by
create_with_combinations
or generate_block_combinations.
Always use this method rather than reading combinations directly from the task or block record: for blocks with 500 or more combinations, embedded combination lists on the block are truncated or omitted.
Results are returned as a lazily paginated iterator. Do not infer the end of results from page size: a page can under-return while more combinations remain.
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Property task ID containing the block (format |
required |
block_id
|
BlockId
|
The block ID whose combinations to list (format |
required |
max_items
|
int
|
Maximum number of combinations to return. If None, iterates over all combinations. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[IntervalCombinationItem]
|
A lazily paginated iterator of combinations. After iteration,
|
Source code in src/albert/collections/tasks.py
get_block_rules
get_block_rules(
*, task_id: TaskId, block_id: BlockId
) -> BlockRules
Get combination rules and overrides for a task block (🧪 Beta).
Returns the rules (ExclusionRule)
and overrides (CombinationOverride)
currently configured on the specified block.
Rules evaluate criteria against parameter setpoints (using AND logic within a
rule and OR logic across rules) to prune combinations in Exclude Mode or include
combinations in Include Mode. Overrides target specific parameter combinations (with
skip or unskip actions) and always take precedence over rules.
Use this method to inspect existing rules before updating them with
set_block_rules
(which automatically regenerates child-workflow combinations by default).
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Property task ID containing the block (format |
required |
block_id
|
BlockId
|
The block ID whose rules to retrieve (format |
required |
Returns:
| Type | Description |
|---|---|
BlockRules
|
The rules and overrides configured on the block. |
Source code in src/albert/collections/tasks.py
882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 | |
add_block_inventory_exclusions
add_block_inventory_exclusions(
*,
task_id: TaskId,
block_id: BlockId,
exclusions: list[InventoryExclusion],
) -> BlockRules
Add inventory x combination exclusions ("masks") to a task block (🧪 Beta).
Each exclusion marks one task-level inventory tuple
(inv_lot_unique_id, occurrence included) as excluded from one interval
combination (interval_row_key). Excluded pairs are omitted from
property-data grids, exports, and data-completeness checks for the block.
Exclusions are validated on save: both the inventory tuple and the
combination row key must exist on the task/block, and masking the same pair
twice is rejected. Additions are idempotent-safe via
get_block_rules:
check inventory_exclusions first if re-running a script.
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Masking an inventory x combination pair
from albert import Albert
from albert.resources.interval_combinations import InventoryExclusion
client = Albert()
# 1. Create the task (a Property task with intervalized workflow blocks)
task = client.tasks.create_with_combinations(task=my_property_task)
# 2. Pick the inventory row to mask. Each task inventory row carries
# its identity as inv_lot_unique_id (e.g. "INV123#LOT456#1").
for inv in task.inventory_information:
print(inv.inventory_id, inv.lot_id, inv.inv_lot_unique_id)
inv_lot_unique_id = task.inventory_information[0].inv_lot_unique_id
# 3. Pick the combination to mask it from. Each combination carries
# its stable identity as interval_row_key (e.g. "ROW3XROW7").
for combo in client.tasks.get_block_combinations(
task_id=task.id, block_id="BLK1"
):
print(combo.name, combo.interval_row_key)
interval_row_key = "ROW3XROW7"
# 4. Mask the pair. That inventory row no longer appears against
# this combination on the block's grid.
client.tasks.add_block_inventory_exclusions(
task_id=task.id,
block_id="BLK1",
exclusions=[
InventoryExclusion(
inv_lot_unique_id=inv_lot_unique_id,
interval_row_key=interval_row_key,
)
],
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Property task ID containing the block (format |
required |
block_id
|
BlockId
|
The block ID whose exclusions to add (format |
required |
exclusions
|
list[InventoryExclusion]
|
Exclusions to add. An empty list is a no-op. |
required |
Returns:
| Type | Description |
|---|---|
BlockRules
|
The block's rules, overrides, and inventory exclusions after the change. |
Source code in src/albert/collections/tasks.py
961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | |
remove_block_inventory_exclusions
remove_block_inventory_exclusions(
*,
task_id: TaskId,
block_id: BlockId,
exclusion_ids: list[str],
) -> BlockRules
Remove inventory x combination exclusions ("masks") from a task block (🧪 Beta).
Unmasks previously excluded inventory x combination pairs; the pairs render again on property-data grids.
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Unmasking pairs
from albert import Albert
client = Albert()
# Read the block's current masks; each has a server-assigned id.
rules = client.tasks.get_block_rules(task_id="TASFOR1", block_id="BLK1")
# Unmask everything on the block (or pick specific ones by id).
client.tasks.remove_block_inventory_exclusions(
task_id="TASFOR1",
block_id="BLK1",
exclusion_ids=[e.id for e in rules.inventory_exclusions],
)
Changing a mask
A mask has no editable fields (it is the pair), so changing one means removing it and adding the new pair:
from albert import Albert
from albert.resources.interval_combinations import InventoryExclusion
client = Albert()
rules = client.tasks.get_block_rules(task_id="TASFOR1", block_id="BLK1")
# The mask pointing at the wrong combination:
old = next(
e for e in rules.inventory_exclusions
if e.inv_lot_unique_id == "INV123#LOT456#1"
)
client.tasks.remove_block_inventory_exclusions(
task_id="TASFOR1", block_id="BLK1", exclusion_ids=[old.id]
)
client.tasks.add_block_inventory_exclusions(
task_id="TASFOR1",
block_id="BLK1",
exclusions=[
InventoryExclusion(
inv_lot_unique_id=old.inv_lot_unique_id,
interval_row_key="ROW3XROW8", # the right combination
)
],
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Property task ID containing the block (format |
required |
block_id
|
BlockId
|
The block ID whose exclusions to remove (format |
required |
exclusion_ids
|
list[str]
|
Server-assigned exclusion IDs (UUIDs), from
|
required |
Returns:
| Type | Description |
|---|---|
BlockRules
|
The block's rules, overrides, and inventory exclusions after the change. |
Source code in src/albert/collections/tasks.py
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 | |
set_block_rules
set_block_rules(
*,
task_id: TaskId,
block_id: BlockId,
rules: list[ExclusionRule] | None = None,
overrides: list[CombinationOverride] | None = None,
generate_combinations: bool = True,
old_workflow_id: WorkflowId | None = None,
wait: bool = True,
) -> BlockRules
Set combination rules and overrides for a task block (🧪 Beta).
Configures or replaces rules and overrides on the specified block, and by default immediately recomputes and regenerates child-workflow combinations on Albert.
Rules, Overrides, and Baseline Modes:
- Rules (Criteria-Based Filtering): A rule consists of one or more conditions comparing parameter values against thresholds. All conditions within a rule must match (AND logic). If any rule matches (OR logic across rules):
- In Exclude Mode (
intervals_start_from="all", default), the combination is excluded. - In Include Mode (
intervals_start_from="none"), the combination is included. - Overrides (Targeted Setpoint Overrides): Overrides target a specific combination variant by its exact parameter values:
action=OverrideAction.SKIP: explicitly excludes the combination.action=OverrideAction.UNSKIP: explicitly keeps or forces inclusion of the combination.- In Include Mode (
"none"), setis_manual=Trueto designate a manually cherry-picked combination. - Overrides are evaluated first and always take precedence over rules.
Follows the unset-is-not-empty convention:
- Omitting
rules(or leaving it asNone) leaves existing rules untouched. - Passing an empty list (
rules=[]) clears all rules on the block. - The same convention applies to
overrides. - At least one of
rulesoroverridesmust be provided.
When generate_combinations=True (the default), the method persists the rules and
immediately triggers generate_block_combinations,
passing the block's current workflow as old_workflow_id so that unchanged barcodes
are preserved and obsolete combinations are voided. Set generate_combinations=False
to save rule definitions only without triggering combination regeneration.
Rules and overrides can be constructed easily from parameter names and values using
Workflow.build_rule and
Workflow.build_override
on the block's parent workflow. Override keys can also be computed directly using
Workflow.get_override_key.
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Example
from albert import Albert
from albert.resources.interval_combinations import (
CombinationOverride,
ExclusionRule,
OverrideAction,
RuleCondition,
RuleOperator,
)
client = Albert()
block_rules = client.tasks.set_block_rules(
task_id="TASFOR1",
block_id="BLK1",
rules=[
ExclusionRule(
name="Exclude high temp and high speed",
conditions=[
RuleCondition(
parameter_group_id="PRG247776",
parameter_id="PRM100",
row_id="ROW2",
operator=RuleOperator.GTE,
value="90",
unit_id="UNI1",
),
RuleCondition(
parameter_group_id="PRG247776",
parameter_id="PRM200",
row_id="ROW5",
operator=RuleOperator.GTE,
value="1500",
unit_id="UNI2",
),
],
)
],
overrides=[
CombinationOverride(
key="PRG247776#PRM100#ROW4-PRG247776#PRM200#ROW9",
action=OverrideAction.SKIP,
),
],
)
# Combinations are regenerated automatically:
print(block_rules.job.state)
# 'successful'
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Property task ID containing the block (format |
required |
block_id
|
BlockId
|
The block ID whose rules to set (format |
required |
rules
|
list[ExclusionRule]
|
Replacement rules for the block. If omitted ( |
None
|
overrides
|
list[CombinationOverride]
|
Replacement overrides for the block. If omitted ( |
None
|
generate_combinations
|
bool
|
Whether to automatically regenerate child-workflow combinations after saving rules. Defaults to True. |
True
|
old_workflow_id
|
WorkflowId
|
Prior workflow ID to pass to the generation job for barcode preservation and voiding obsolete combinations. Defaults to the block's current workflow ID. |
None
|
wait
|
bool
|
Whether to wait for the background generation worker job to finish when
|
True
|
Returns:
| Type | Description |
|---|---|
BlockRules
|
The updated rules and overrides for the block. If |
Raises:
| Type | Description |
|---|---|
ValueError
|
If both |
TypeError
|
If the task is not a PropertyTask. |
AlbertException
|
If combination generation fails or exceeds platform caps. |
Source code in src/albert/collections/tasks.py
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 | |
generate_block_combinations
generate_block_combinations(
*,
task_id: TaskId,
block_id: BlockId,
old_workflow_id: WorkflowId | None = None,
wait: bool = True,
) -> WorkerJob
Generate child-workflow interval combinations for a task block (🧪 Beta).
Calculates combination variants from the block's workflow, rules, and overrides, then launches a background generation job to materialize the child workflows on the platform.
Combination Generation Lifecycle:
- Cartesian Product: Evaluates combinations across all intervalized workflow parameters
starting from the block's baseline mode (
intervals_start_from="all"for Exclude Mode, starting with all combinations; or"none"for Include Mode, starting with an empty set). - Rules and Overrides: Applies rules (AND logic within a rule, OR logic across rules) and overrides (which take precedence over rules) to determine active combinations.
- Child Workflows and Barcodes: Each active combination materializes as an independent child workflow record linked to the task block. Every combination receives a unique, persistent interval barcode that remains stable across rule updates as long as the parameter setpoints are unchanged.
How to set old_workflow_id across common caller scenarios:
- First-time generation (or retrying after a failed create job): leave
old_workflow_id=None(the default). - Regenerating after updating rules: pass the block's current workflow ID
(e.g. from
block.workflow[0].id). - Regenerating after swapping a workflow: pass the previous workflow ID
that was replaced (the one passed to
update_block_workflow).
Once generation finishes, retrieve the resulting combinations using
get_block_combinations.
Beta Feature!
Increased intervals combination support is currently in beta and behind a platform feature flag. Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The Property task ID containing the block (format |
required |
block_id
|
BlockId
|
The block ID whose combinations to generate (format |
required |
old_workflow_id
|
WorkflowId
|
The ID of the workflow being replaced or re-evaluated (format |
None
|
wait
|
bool
|
Whether to wait until background generation reaches a terminal state. If False, returns immediately after the generation job is submitted. |
True
|
Returns:
| Type | Description |
|---|---|
WorkerJob
|
The background worker job representing child workflow generation, with
fields like |
Notes
When triggering combination generation across multiple blocks sequentially on the same task, pace consecutive calls by at least 10 seconds between blocks.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the block is not found or has no assigned workflow. |
TypeError
|
If the task is not a PropertyTask. |
AlbertException
|
If the generated combinations exceed the platform cap of 2,000, or if
|
Source code in src/albert/collections/tasks.py
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 | |
remove_block
Remove a Block from a Property or Batch task.
Removing a block also removes the results captured against it. To keep the
block but change its conditions, use update_block_workflow instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The task to remove the block from (e.g. |
required |
block_id
|
BlockId
|
The block to remove (e.g. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/tasks.py
import_results
import_results(
*,
task_id: TaskId,
data_template_id: DataTemplateId,
inventory_id: InventoryId | None = None,
block_id: BlockId | None = None,
attachment_id: AttachmentId | None = None,
file_path: str | Path | None = None,
note_text: str | None = None,
lot_id: LotId | None = None,
interval: str = "default",
field_mapping: dict[str, str] | None = None,
mode: ImportMode = CSV,
schema_version: Literal[1, 2] | None = None,
) -> BaseTask
Import results from an attachment into property data. Reuse an existing attachment or upload a new one, optionally provide header-to-column mappings, and target the desired block, lot, and interval. Returns the task after the import.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The property task receiving the results. |
required |
data_template_id
|
DataTemplateId
|
Data template Id. |
required |
inventory_id
|
InventoryId | None
|
Inventory item id. Required when |
None
|
block_id
|
BlockId | None
|
Target block on the task where the data will be written. Optional when a single block is present on the task. If multiple blocks exist, this parameter must be provided. |
None
|
attachment_id
|
AttachmentId | None
|
Existing attachment to use. Exactly one of |
None
|
file_path
|
str | Path | None
|
Local file to upload and attach to a new note on the task. Exactly one of
|
None
|
note_text
|
str | None
|
Optional text for the note created when uploading a new file. |
None
|
lot_id
|
LotId | None
|
Lot context when deleting/writing property data. |
None
|
interval
|
str
|
Interval combination to write to, as an interval ID ( |
'default'
|
field_mapping
|
dict[str, str] | None
|
Optional mapping from CSV header labels to data column names. Keys should match the
header text from the CSV (case-insensitive comparison is applied), and values should
match the corresponding data template column names. For example,
|
None
|
mode
|
ImportMode
|
Import mode to use, by default ImportMode.CSV. Use ImportMode.SCRIPT to run a custom script to process the CSV before import. This requires a script attachment on the data template. |
CSV
|
schema_version
|
(1, 2)
|
The TaskMetadata schema version to send to the script execution runner. When None (the default), automatically detected from the block's Increased Intervals configuration (version 2 if increased intervals are configured on the block, otherwise version 1). Explicitly pass 1 for legacy ROW payloads or 2 for Increased Intervals compact payloads. |
1
|
Returns:
| Type | Description |
|---|---|
BaseTask
|
The task with the newly imported results. |
Source code in src/albert/collections/tasks.py
1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 | |
delete
Delete a task by its ID.
Deleting a task also removes any results recorded against its blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
TaskId
|
The task to delete (format |
required |
delay
|
int
|
Time in milliseconds the platform waits before running post-delete synchronization of dependent records. Omit for no delay. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/tasks.py
get_by_id
Get a single, fully populated task by its ID.
The returned object is the concrete type matching the task's category:
PropertyTask, BatchTask, or GeneralTask. For a PropertyTask
this includes its blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
TaskId
|
The task to retrieve (format |
required |
Returns:
| Type | Description |
|---|---|
BaseTask
|
The fully populated task. |
Source code in src/albert/collections/tasks.py
search
search(
*,
text: str | None = None,
tags: list[str] | None = None,
task_id: list[TaskId] | None = None,
linked_task: list[TaskId] | None = None,
category: TaskCategory | str | list[str] | None = None,
albert_id: list[str] | None = None,
data_template: list[str] | None = None,
assigned_to: list[str] | None = None,
assigned_to_id: list[str] | None = None,
location: list[str] | None = None,
priority: list[str] | None = None,
status: list[str] | None = None,
parameter_group: list[str] | None = None,
created_by: list[str] | None = None,
project_id: ProjectId | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
updated_by: str | list[str] | None = None,
from_updated_at: str | None = None,
to_updated_at: str | None = None,
additional_field: str | list[str] | None = None,
collaborator_pop_up: bool | None = None,
contains_field: list[str] | None = None,
contains_text: list[str] | None = None,
due_date_duration: str | None = None,
facet_field: str | None = None,
facet_text: str | None = None,
has_attachment: str | list[str] | None = None,
has_notes: str | list[str] | None = None,
linked_to: list[str] | None = None,
source_field: str | list[str] | None = None,
witness_status: list[str] | None = None,
metadata_filters: dict[str, Any] | None = None,
order_by: OrderBy = DESCENDING,
sort_by: str | None = None,
max_items: int | None = None,
offset: int = 0,
) -> Iterator[TaskSearchItem]
Search for tasks matching the given filters.
Returns lightweight, partially populated results and is the fastest way to
look tasks up. When you need complete tasks (e.g. a PropertyTask's blocks),
use get_all with the same filters, or pass the resulting IDs to
get_by_id. Results are returned as a lazily paginated iterator.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text search across multiple task fields. |
None
|
tags
|
list[str]
|
Filter by tags associated with tasks. |
None
|
task_id
|
list[str]
|
Filter by task IDs (e.g., |
None
|
linked_task
|
list[str]
|
Task IDs linked to the ones being searched. |
None
|
category
|
TaskCategory
|
Filter by task category: |
None
|
albert_id
|
list[str]
|
Filter by Albert IDs of entities linked to the tasks (e.g. inventory
IDs like |
None
|
data_template
|
list[str]
|
Data template names associated with tasks. |
None
|
assigned_to
|
list[str]
|
User names assigned to the tasks. |
None
|
location
|
list[str]
|
Locations where tasks are carried out. |
None
|
priority
|
list[str]
|
Priority levels for filtering tasks. |
None
|
status
|
list[str]
|
Task status values (e.g., Open, Done). |
None
|
parameter_group
|
list[str]
|
Parameter Group names associated with tasks. |
None
|
created_by
|
list[str]
|
Filter by creator. Accepts user display name(s) or UserId(s) (e.g.
|
None
|
project_id
|
ProjectId
|
ID of the parent project for filtering tasks. |
None
|
from_created_at
|
str
|
Only include items created on or after this date (ISO 8601). |
None
|
to_created_at
|
str
|
Only include items created on or before this date (ISO 8601). |
None
|
updated_by
|
str or list[str]
|
Filter by user(s) who last updated the tasks. Accepts UserId(s) only
(e.g. |
None
|
from_updated_at
|
str
|
Only include items updated on or after this date (ISO 8601). |
None
|
to_updated_at
|
str
|
Only include items updated on or before this date (ISO 8601). |
None
|
assigned_to_id
|
list[str]
|
Filter by assigned user ID(s) (e.g. |
None
|
additional_field
|
str or list[str]
|
Request additional columns from the search index. |
None
|
collaborator_pop_up
|
bool
|
When True, restrict results for the collaborator pop-up UI. |
None
|
contains_field
|
list[str]
|
Fields to search inside. |
None
|
contains_text
|
list[str]
|
Values to search for within |
None
|
due_date_duration
|
str
|
Filter by due date duration bucket. |
None
|
facet_field
|
str
|
Facet field to filter on. |
None
|
facet_text
|
str
|
Facet text to search for. |
None
|
has_attachment
|
str or list[str]
|
Filter tasks by attachment presence. |
None
|
has_notes
|
str or list[str]
|
Filter tasks by note presence. |
None
|
linked_to
|
list[str]
|
Filter by linked entity ID(s). |
None
|
source_field
|
str or list[str]
|
Restrict which fields are returned in the response. |
None
|
witness_status
|
list[str]
|
Filter by witness status (e.g. |
None
|
metadata_filters
|
dict[str, Any]
|
Filter by custom field (metadata) values. |
None
|
order_by
|
OrderBy
|
The order in which to return results (asc or desc), default DESCENDING. |
DESCENDING
|
sort_by
|
str
|
Attribute to sort tasks by (e.g., createdAt, name). |
None
|
max_items
|
int
|
Maximum number of tasks to return in total. If None, iterates over all matches. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[TaskSearchItem]
|
A lazily paginated iterator of partially populated search results. |
Source code in src/albert/collections/tasks.py
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 | |
get_all
get_all(
*,
text: str | None = None,
tags: list[str] | None = None,
task_id: list[TaskId] | None = None,
linked_task: list[TaskId] | None = None,
category: TaskCategory | str | list[str] | None = None,
albert_id: list[str] | None = None,
data_template: list[str] | None = None,
assigned_to: list[str] | None = None,
assigned_to_id: list[str] | None = None,
location: list[str] | None = None,
priority: list[str] | None = None,
status: list[str] | None = None,
parameter_group: list[str] | None = None,
created_by: list[str] | None = None,
project_id: ProjectId | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
updated_by: str | list[str] | None = None,
from_updated_at: str | None = None,
to_updated_at: str | None = None,
additional_field: str | list[str] | None = None,
collaborator_pop_up: bool | None = None,
contains_field: list[str] | None = None,
contains_text: list[str] | None = None,
due_date_duration: str | None = None,
facet_field: str | None = None,
facet_text: str | None = None,
has_attachment: str | list[str] | None = None,
has_notes: str | list[str] | None = None,
linked_to: list[str] | None = None,
source_field: str | list[str] | None = None,
witness_status: list[str] | None = None,
metadata_filters: dict[str, Any] | None = None,
order_by: OrderBy = DESCENDING,
sort_by: str | None = None,
max_items: int | None = None,
offset: int = 0,
) -> Iterator[BaseTask]
Get fully populated tasks matching the given filters.
Accepts the same filters as search but returns complete task
entities (PropertyTask, BatchTask, or GeneralTask) rather than
lightweight search results. This is slower because it fetches full detail
for every match, so prefer search when you only need names, IDs, or
status. Results are returned as a lazily paginated iterator.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text search across multiple task fields. |
None
|
tags
|
list[str]
|
Filter by tags associated with tasks. |
None
|
task_id
|
list[str]
|
Filter by task IDs (e.g. |
None
|
linked_task
|
list[str]
|
Task IDs linked to the ones being searched. |
None
|
category
|
TaskCategory
|
Filter by task category: |
None
|
albert_id
|
list[str]
|
Filter by Albert IDs of entities linked to the tasks (e.g. inventory
IDs like |
None
|
data_template
|
list[str]
|
Data template names associated with tasks. |
None
|
assigned_to
|
list[str]
|
User names assigned to the tasks. |
None
|
location
|
list[str]
|
Locations where tasks are carried out. |
None
|
priority
|
list[str]
|
Priority levels for filtering tasks. |
None
|
status
|
list[str]
|
Task status values (e.g. |
None
|
parameter_group
|
list[str]
|
Parameter Group names associated with tasks. |
None
|
created_by
|
list[str]
|
Filter by creator. Accepts user display name(s) or UserId(s) (e.g.
|
None
|
project_id
|
ProjectId
|
ID of the parent project for filtering tasks. |
None
|
from_created_at
|
str
|
Only include items created on or after this date (ISO 8601). |
None
|
to_created_at
|
str
|
Only include items created on or before this date (ISO 8601). |
None
|
updated_by
|
str or list[str]
|
Filter by user(s) who last updated the tasks. Accepts UserId(s) only
(e.g. |
None
|
from_updated_at
|
str
|
Only include items updated on or after this date (ISO 8601). |
None
|
to_updated_at
|
str
|
Only include items updated on or before this date (ISO 8601). |
None
|
assigned_to_id
|
list[str]
|
Filter by assigned user ID(s) (e.g. |
None
|
additional_field
|
str or list[str]
|
Request additional columns from the search index. |
None
|
collaborator_pop_up
|
bool
|
When True, restrict results for the collaborator pop-up UI. |
None
|
contains_field
|
list[str]
|
Fields to search inside. |
None
|
contains_text
|
list[str]
|
Values to search for within |
None
|
due_date_duration
|
str
|
Filter by due date duration bucket. |
None
|
facet_field
|
str
|
Facet field to filter on. |
None
|
facet_text
|
str
|
Facet text to search for. |
None
|
has_attachment
|
str or list[str]
|
Filter tasks by attachment presence. |
None
|
has_notes
|
str or list[str]
|
Filter tasks by note presence. |
None
|
linked_to
|
list[str]
|
Filter by linked entity ID(s). |
None
|
source_field
|
str or list[str]
|
Restrict which fields are returned in the response. |
None
|
witness_status
|
list[str]
|
Filter by witness status (e.g. |
None
|
metadata_filters
|
dict[str, Any]
|
Filter by custom field (metadata) values. |
None
|
order_by
|
OrderBy
|
Sort direction. Default |
DESCENDING
|
sort_by
|
str
|
Attribute to sort tasks by (e.g. |
None
|
max_items
|
int
|
Maximum number of tasks to return in total. If None, iterates over all matches. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[BaseTask]
|
Fully populated tasks. Preserves |
Source code in src/albert/collections/tasks.py
2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 | |
update
Update an existing task.
Fetch the task (e.g. with get_by_id), modify the updatable fields,
then pass it here. Only the fields listed in Notes are applied. To change a
task's blocks, use add_block, remove_block, or
update_block_workflow instead.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
BaseTask
|
The task to update. Must have a valid |
required |
Returns:
| Type | Description |
|---|---|
BaseTask
|
The updated task. |
Notes
The following fields can be updated: assigned_to, due_date,
inventory_information, metadata, name, priority, project,
state, tags.
Any tags that do not yet exist in Albert are created automatically.
Source code in src/albert/collections/tasks.py
get_history
get_history(
*,
id: TaskId,
order: OrderBy = DESCENDING,
limit: int = 1000,
entity: HistoryEntity | None = None,
blockId: str | None = None,
startKey: str | None = None,
) -> TaskHistory
Get the audit history for a task.
Returns the chronological record of changes made to the task (and, optionally, a specific block).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
TaskId
|
The task to inspect (format |
required |
order
|
OrderBy
|
Sort direction for history entries. Default |
DESCENDING
|
limit
|
int
|
Maximum number of history entries to return. |
1000
|
entity
|
HistoryEntity
|
Restrict history to a specific entity scope (e.g. |
None
|
blockId
|
str
|
Restrict history to a specific block. |
None
|
startKey
|
str
|
Pagination key used to continue a previous history query. |
None
|
Returns:
| Type | Description |
|---|---|
TaskHistory
|
The task's history entries plus pagination metadata. |