.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto/remote_access/remote_workflow.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_remote_access_remote_workflow.py: Running a Workflow ------------------ Workflows on their own are not runnable directly. However, a launchplan is always bound to a workflow and you can use launchplans to **launch** a workflow. For cases in which you want the launchplan to have the same arguments as a workflow, if you are using one of the SDK's to author your workflows - like flytekit, flytekit-java etc, then they should automatically create a ``default launchplan`` for the workflow. A ``default launchplan`` has the same name as the workflow and all argument defaults are similar. See :ref:`sphx_glr_auto_remote_access_remote_launchplan.py` to run a workflow via the default launchplan. :ref:`Tasks also can be executed ` using the launch command. One difference between running a task and a workflow via launchplans is that launchplans cannot be associated with a task. This is to avoid triggers and scheduling. FlyteRemote =========== Workflows can be executed with FlyteRemote because under the hood it fetches and triggers a default launch plan. .. code-block:: python from flytekit.remote import FlyteRemote from flytekit.configuration import Config # FlyteRemote object is the main entrypoint to API remote = FlyteRemote( config=Config.for_endpoint(endpoint="flyte.example.net"), default_project="flytesnacks", default_domain="development", ) # Fetch workflow flyte_workflow = remote.fetch_workflow(name="workflows.example.wf", version="v1") # Execute execution = remote.execute( flyte_workflow, inputs={"mean": 1}, execution_name="workflow_execution", wait=True ) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_remote_access_remote_workflow.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: remote_workflow.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: remote_workflow.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_