itasca_execute_task
Submit a Python script file for asynchronous execution in the Itasca engine; returns a task ID for background simulation runs and lifecycle polling.
Instructions
Submit a Python script file for asynchronous execution in the Itasca engine.
Returns a task_id immediately; the script runs in the background. Companion tools manage the lifecycle:
itasca_check_task_status: poll output, progress, and final status
itasca_interrupt_task: cancel a running task
itasca_list_tasks: browse task history For synchronous, inline execution, use itasca_execute_code instead.
While the task is cycling, itasca_execute_code shares the same main namespace in the engine's main thread, so you can inspect or modify simulation state live — probe progress, tune parameters mid-run, swap callbacks, or trigger early termination via a sentinel variable. Submit with reasonable starting values and refine as the task runs.
Console output from itasca.command() inside the script (table dumps, list output, command summaries) is captured into the task log alongside Python prints, visible through itasca_check_task_status.
Script-writing rules:
Multi-line itasca.command("""...""") batches are normalized to one engine call per command, keeping the task interruptible mid-batch. Normalization recognizes itasca.command through its import name; call it through that name directly — rebinding via intermediate variables (
_it = itasca) bypasses it and logs a bridge warning.Pass each FISH definition block (
fish define/fish operator/ legacy baredefine, through its terminating standaloneend) whole, in ONE itasca.command() string; feeding one line-by-line leaves the engine blocked in interactive FISH mode until completed manually in the GUI console. Per-line loops are fine for ordinary commands.program call '<file>'(.p3dat / .p2dat / .dat / ...) is supported: the bridge runs the file inline, one command per engine call, so the bridge stays reachable, the task stays interruptible, and the file's output lands in the task log command by command.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Brief task purpose | |
| entry_script | Yes | Absolute path to entry Python script in the Itasca engine workspace |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||