Trigger a Job
What you'll learn
- Triggering Jobs via Python SDK and TrueFoundry Dashboard
This is a guide for triggering jobs via servicefoundry
and TrueFoundry Dashboard. This guide assumes you have deployed a job previously. If not, then please refer to the Deploy a Job guide to know more about job deployment.
To trigger a job, you have two options:
Triggering a Job through TrueFoundry Dashboard
You can find the link to the Job Details from the Truefoundry dashboard on the Deployments page.

Jobs list
You can trigger a job manually by Clicking the Trigger Job button from the Job Details UI.

We can now visit our Applications page to check the Build status, Build Logs, Runs History and monitor the progress of runs. See Monitoring and Debugging guide for more details.
Triggering a Job Programmatically
Requires:
servicefoundry
library with version >= 0.8.0 (useservicefoundry --version
to see version)
You can trigger your job programmatically by using the trigger_job
function as shown below:
from servicefoundry import Job, trigger_job
# Configure a Job Deployment
job = Job(...)
# Deploy a Job
job_deployment = job.deploy(workspace_fqn="YOUR WORKSPACE FQN")
# Trigger/Run a Job
trigger_job(
application_fqn=job_deployment.application_fqn,
command="YOUR COMMAND TO RUN JOB"
)
servicefoundry.trigger_job
servicefoundry.trigger_job
Arguments:
-
application_fqn (
str
): Fully Qualified Name of the Deployed Job (without the version number) -
command(
Optional[Union[str, Sequence[str]]]
): Command to run the job with, defaults toNone
. Can be astr
orList[str]
. WhenNone
, the job is triggered with configured command at the time of deployment. When passed as a list, the command will be joined using theshlex.join
function. -
params(
Optional[Dict[str, str]]
): Params to run the job with, defaults toNone
. Needs to be aDict[str, str]
. This is to be used when you have deployed a job with parameters. You can pass the param_name and param_value in a Dictionary and run the following:from servicefoundry import trigger_job trigger_job( application_fqn="tfy-ctl-euew1-devtest:tfy-demo:iris-train-job", params={"kernel":"lin", "n_quantiles":"420"} )
Returns:
Deployment
object
See Also
Updated 5 days ago