Using Julia in a task type

Julia can be used in a task type if Core.Host.Julia is installed.

For example Example.Julia.PlotXY uses Julia to create a simple plot:

The main contains the boilerplate XamFlow input and output handling, and uses to execute a Julia script:

import xfworkerutil
import runutil
import os

worker = xfworkerutil.XFWorkerJob()

inputs = worker.job['inputs']

# Download input files
table_path = worker.download_input_file(inputs['table'])

plot_path = worker.create_related_path(table_path, '_plot.png')

# Run Julia script"Julia", [os.environ['JULIA_EXE'], "plot.jl", str(table_path), str(plot_path)])

# Upload output files

# Save outputs
outputs = {
    "plot": worker.create_output_bitmap(,

The plot.jl script contains the Julia code:

using CSV
using DataFrames
using Plots

# Use GR Plots

# Open CSV-file
df = DataFrame(CSV.File(ARGS[1]))

# Column nr x-axis
xname = names(df)[1]
x = df[!, xname]
# Column nr y-axis
yname = names(df)[2]
y = df[!, yname]

# Regression line
scatter!(x, y, label="$xname / $yname")
bhat = [x ones(length(x))]\y
Plots.abline!(bhat..., label="Regression")

# Save plot