Any plans for R?

I like the idea of using Temporal for data pipelines as shown in temporal’s Python tutorial but I primarily work in R. Are there any plans to integrate Temporal with R?

What type of integration do you need? You can always invoke R scripts from Python or any other SDK activities.

Maybe an example of how to translate the example to R would be enough to set me going. I don’t have experience invoking R from Python, and there look to be a number of options (rpy2, subprocesses). As a complete beginner to Temporal, I wonder which approach is most suited.

What problem are you trying to solve at high level?

Scheduling repeated tasks without scattered scheduling logic.

Currently I use CRON in combination with bash scripts like the example below for scheduling data pipelines/emailing/report generation. I considered using systemd or workflow orchestrators.

The data I primarily work with is human resource transactions which get finalized after every bi-weekly payroll. I’d like to pull (from an API) and upload (to a database) daily, and bi-weekly pull again from the API and replace the database’s prior 2 weeks of data.

#!/bin/bash

current_date=$(date +"%Y-%m-%d")
dec_24=$(date -d "12/24" +"%Y-%m-%d")
jan_03=$(date -d "01/03" +"%Y-%m-%d")

if [[ "$current_date" > "$dec_24" || "$current_date" < "$jan_03" ]]; then
    echo "Program does not run during holiday. Exiting with success."
    exit 0
else
    docker run --rm --name shovel_container shovel_image
    exit $?
fi

I see. I would rewrite the bash script as a workflow and invoke the docker run from an activity. Then, you can use the schedule feature to run this workflow periodically.

Thank you Maxim. Yes that’s an option. I guess my question is whether a native R SDK could be of interest? Data pipelines being a popular scheduling task, and R being well suited for data pipelines.

Otherwise like you said I can just invoke R scripts (dockerized or not). But I’m not a Python user. So I could just as well choose Go for this.

Your first reply makes me wonder “What is the reason for the Python tutorial? You can always invoke Python scripts from the other SDKs.” Is it just because Python is a common language (for data pipelines)? R is too I would think.

Yes, this is mainly based on the popularity of the language. I don’t know much about R to comment on if it would be a good language to write workflows. I think you are the first one who asked for this.

1 Like